简体   繁体   中英

ListView inside ScrollView issue

I need to make layout just like this from picture below. Where you can see that I have user info area, review area and comments area.

The entire layout should be scrollable, because review should be very long, and that review could have a lot of comments.

Also comments area is ListView, so I thought that I should use ScrollView to scroll all layout, but it doesn't work well with ListView.

Is there any solution?

在此处输入图片说明

Here is the picture when I use ListView with header and footer . 在此处输入图片说明

Do not ever use Listview inside ScrollView because Listview already contain the functionality of scrolling. Just use Fill_parent for width and height it will automatically scroll.

android:layout_width="fill_parent"
android:layout_height="fill_parent"

And for scrolling the whole layout you can put the review part inside header of the 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