From the course: Android Development Essential Training: 1 Your First App
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Display Views in a ViewGroup - Android Tutorial
From the course: Android Development Essential Training: 1 Your First App
Display Views in a ViewGroup
- [Instructor] You can design user interface layouts in the same way you create webpages in HTML, using nested elements. In Android, each layout file must contain exactly one root element, like you see here with this LinearLayout. Once you've defined the root element, you can add additional layouts or widgets as children in order to define your user interface. Every view in view group objects supports their own variety of XML attributes. These attributes have the following characteristics. Some are inherited from the base view class, others are specific to the type of view object that is being configured. And finally, some relate to how the view is positioned inside its parent. Let's look at a few examples. We're back in Android Studio with the activity_main.xml file. Let's walk through this line by line, so you know exactly how attributes work in XML. On line one, this is how we specify that this is an XML file.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Define screens with activities4m 20s
-
(Locked)
Implement designs in XML layouts2m 47s
-
(Locked)
Introduction to Views and ViewGroups3m 19s
-
(Locked)
Display Views in a ViewGroup3m 28s
-
(Locked)
Units of measurement in Android4m 10s
-
(Locked)
Challenge: App template1m
-
(Locked)
Solution: App template3m 20s
-
(Locked)
-