Differences between Android 1.5 and Android 2.1 in relative layout (relativelayout)

Source: Internet
Author: User
This article is original. If you need to reprint it, please indicate the author and the source. Thank you!

I am working onProgram, You need to dynamically expand each list item in the listview. You can set the Android: visibility attribute of some components in the list item to gone. When you need to display this component, set the Android: visibility attribute to visible. The layout of the list items is relativelayout. Android: components whose visibility attribute is gone are also involved in relative position settings. For example, there are three components: A, B, and C. The Android: visibility attribute value of B is gone, that is, B is not displayed. And a and c display. The relative position is B under a, and C under B. This is no problem in theory. Because the android 2.1 simulator is started, the list item looks completely normal. 1.

Figure 1 Display Effect of the android 2.1 Simulator

Finally, I tested it on the android 1.5 simulator and finally made a big event. Android: The component whose visibility attribute is gone is not considered. If the reference component of a visual widget is not displayed, the widget is displayed in the upper left corner of the list item. The effect of overlapping texts. 2.

Figure 2 Android 1.5 simulator (Text overlapping effect)

it seems that to write a specific version of the android program, you have to honestly use the corresponding version of the android Simulator for testing. I don't know which version of Android starts to use components that are not displayed as Reference Components. I may need to try it, but in any case, Android 2.1 has changed. Finally, we have to reconsider the layout problem. I hope you should pay attention to this when using similar functions. I hope that android 2.1 and later versions will not be converted into other processing methods.

Related Article

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.