安卓:有滚动型中列表视图列表视图使滚动不happend。 [英] android:there are a listview in ScrollView so listview Scrolling not happend.
问题描述
我有这种类型的布局
<LinearLayout>
<ScrollView>
<LinearLayout>
<ImageView/>
<button>
<ListView>
</LinearLayout>
</ScrollView>
所以,在这种情况下我的列表视图滚动不发生,我查看滚动功能执行
我想也可以执行列表视图滚动时的数据更多。和列表视图是需要投入滚动视图父布局,如何解决这个问题,请帮助我。
So in this Case my List view Scrolling not happens and my View Scrolling is perform i want also perform Listview Scrolling when data is more. and List view is need to put in Scroll view parent layout so how can solve this problem please help me.
推荐答案
不要把一个的ListView
内部的滚动型
。 从不。你有两个选择:
Never put a ListView
inside of a ScrollView
. Never. You have two options:
-
如果你不一定要在
的ImageView
和按钮
滚动而去,只是删除滚动型
:
If you don't necessarily want the
ImageView
andButton
to scroll away, just remove theScrollView
:
<LinearLayout android:orientation="vertical" ...>
<ImageView .../>
<Button .../>
<ListView .../>
</LinearLayout>
这一个是稍微复杂一些。实现自定义列表适配器(通过延伸 BaseAdapter 的,例如,或者一个它的子类),并在你的 getView
方法返回的ImageView
和按钮
对位置0和1,分别。这样一来,你的布局将只包含一个的ListView
,但它的前两个项目将是的ImageView
和按钮
。
This one is slightly more complicated. Implement a custom list adapter (by extending BaseAdapter, for example, or one of its subclasses) and, in your getView
method return the ImageView
and the Button
for positions 0 and 1, respectively. This way, your layout will only contain a ListView
, but its first two items will be the ImageView
and the Button
.
在P.S:千万不要把滚动型
A 的ListView
,无论是。
P.S.: Never put a ScrollView
in a ListView
, either.
这篇关于安卓:有滚动型中列表视图列表视图使滚动不happend。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!