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.