From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Display View components in a ViewGroup

Display View components in a ViewGroup - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Display View components in a ViewGroup

- [Instructor] Each visual widget on the screen is a view, and it's implemented either in the core Android SDK or an external library. As I described previously, you can tell the difference between these by the presence or absence of a package declaration. The presence of a package means that the component is defined in an external library, and the absence means it's a part of the core SDK. I'm going to demonstrate simple screen layout, and I'll start with my content.main.xml file in Design view. This label is currently centered in the middle of the screen. I'm going to select it, and then I'm going to zoom in to make this a little bit easier to work with. And then, I'll remove the constraint to the right edge of the screen. Now I want to create a little bit of space between the top and the left edges of the screen and that label. So I'll go into Text view, and right here in the constraint layout, I'll add a padding setting. And I'll set that to 16dp, or device independent pixels…

Contents