Resolution of conflict between listview nested Scrollview in Android

1、 Using the method of dynamically changing the height of listview on the Internet

This method is only applicable to the case where the item layout is a LinearLayout layout. It cannot be any other layout. Because other layouts (such as relativelayout) do not override onmeasure(), an exception will be thrown during onmeasure(). Therefore, the use is limited.

2、 There is a post on the Internet that adds an attribute Android: fillviewport = "true" in Scrollview, so that the listview can be displayed in full screen. The test failed on my machine.

3、 Rewrite listview and GridView (recommended)

Override listview:

Override GridView:

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

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
分享
二维码
< <上一篇
下一篇>>