简体   繁体   中英

Android listview embedded within scrolling frame

I have seen a lot of talk about not putting ListView in ScrollView, but without the ScrollView I cannot see how I can achieve what I want.

I have a Frame that will display subsets of user information. Eg name, age, location, photos... one of the pieces of information is a list of all products the user is subscribed to, which will obviously have a dynamic size depending on how many items. I want this to be a list within the scrollviewer, I dont want the list to separately scroll, just to be initialised to it's full size within the scrollviewer so all scrolling is handled at the parent scrollview level, then you can click on an item in the list to be taken to the sub page for that item.

If I put the ListView outside the ScrollView, I will get two separate indepedently scrolling areas of the screen which I do not want.

How can I achieve this?

您应该设置listview的高度,但要说它的大小是动态的。您可以获取视图项目,然后测量项目的高度,使listview的高度适合项目的总高度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM