Android develops and implements the method of nesting two listviews in Scrollview

This article describes the method of nesting two listviews in Scrollview for Android development. Share with you for your reference, as follows:

Two listviews should be used to display up and down the same page in the project. Because the data sources are different, the display cannot be distinguished by setting the flag bit in the adapter. Finally, only one Scrollview can be made to nest two listviews, but it cannot be displayed at the same time under normal circumstances. The listview above will be completely displayed, and only one item below will be displayed, I checked some information and finally succeeded

There is mainly a listviewutility with the following code:

Then write two listviews, as follows

Finally, add two listviews to the listviewutility, and the two listviews should be filled before adding. The outermost layer of the layout of the adapter in the two listviews should use LinearLayout. Only LinearLayout can successfully measure the height of each item in the listviewutility, otherwise an error will occur

More readers interested in Android related content can view the topics on this site: summary of Android basic component usage, introduction and advanced tutorial of Android development, summary of Android layout skills, summary of Android view skills, summary of activity operation skills of Android programming, summary of Android resource operation skills, and Android control usage summary

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>