简体   繁体   English

ListView里面的ScrollView问题

[英]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. 另外,注释区域是ListView,所以我认为应该使用ScrollView滚动所有布局,但不适用于ListView。

Is there any solution? 有什么解决办法吗?

在此处输入图片说明

Here is the picture when I use ListView with header and footer . 这是当我将ListView与header和footer一起使用时的图片。 在此处输入图片说明

Do not ever use Listview inside ScrollView because Listview already contain the functionality of scrolling. 永远不要在ScrollView中使用Listview,因为Listview已经包含滚动功能。 Just use Fill_parent for width and height it will automatically scroll. 只需使用Fill_parent作为宽度和高度,它将自动滚动。

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 为了滚动整个布局,您可以将审阅部分放在列表视图的标题内

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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