I. About adding an ID property to a control
<?xml version= "1.0" encoding= "Utf-8"? ><relativelayout xmlns:android= "http://schemas.android.com/apk/res/ Android "Android:layout_width=" Fill_parent "android:layout_height=" fill_parent "android:orientation=" vertical "&G T <include android:id= "@+id/top" android:layout_width= "match_parent" android:layout_height= "Wrap_con Tent "android:layout_alignparenttop=" true "layout=" @layout/top "/> <button android:id=" @+id/ WIFI_TEST_BNT "style=" @style/commonbuttonstyle "android:layout_width=" Match_parent "android:layout_he ight= "Wrap_content" android:layout_below= "@+id/top" android:text= "@string/wifi_setting"/> <!--WIF I test item Tips--<textview android:id= "@+id/tv_hint" android:layout_width= "Wrap_content" Android: layout_height= "Wrap_content" android:layout_alignparentstart= "true" android:layout_below= "@+id/wifi_test_bnt "Android:text=" @strIng/global_test_str "android:visibility=" Gone "/> <listview android:id=" @+id/wifi_listview " Android:layout_width= "Fill_parent" android:layout_height= "wrap_content" android:layout_above= "@+id/bottom" android:layout_below= "@id/wifi_test_bnt" android:text= "@string/hello" > </ListView> <includ E android:id= "@+id/bottom" android:layout_width= "match_parent" android:layout_height= "Wrap_content" Android:layout_alignparentbottom= "true" layout= "@layout/bottom"/></relativelayout>
As mentioned above, the actual layout effect is as follows:
The id attribute is actually added for the bottom layout, which is where it was before it was defined. That is, when you define the ListView, the id attribute is added for the bottom layout.
One uses the android:layout_above= "@+id/bottom" and the other uses the android:id= "@id/bottom"
Android general layout methods and methods