1. What is relative layout (relativelayout)
2. Why relative layout?
3. Two common attributes of relative Layout
1. What is relative layout (relativelayout)
2. Why relative layout?
Nesting in the android layout consumes more resources !!!
3. Two common attributes of relative Layout
The Code is as follows:
1 <relativelayout xmlns: Android = "http://schemas.android.com/apk/res/android" 2 xmlns: Tools = "http://schemas.android.com/tools" 3 Android: layout_width = "match_parent" 4 Android: layout_height = "match_parent" 5 tools: context = "first. pack. mainactivity $ placeholderfragment "> 6 7 <textview 8 Android: Id =" @ + ID/firstview "// create ID 9 Android: layout_width =" wrap_content "10 Android: layout_height = "wrap_content" 11 Android: Background = "# ff0000" 12 Android: text = "hello_world"/> 13 14 <textview15 Android: layout_width = "wrap_content" 16 Android: layout_height = "wrap_content" 17 Android: layout_torightof = "@ + ID/firstview" // determine the relative position based on the ID 18 Android: Background = "#00ff00" 19 Android: TEXT = "hello_mirror"/> 20 21 </relativelayout>