Android general layout methods and methods

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.