安卓:有滚动型中列表视图列表视图使滚动不happend。 [英] android:there are a listview in ScrollView so listview Scrolling not happend.

查看:121
本文介绍了安卓:有滚动型中列表视图列表视图使滚动不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:


  1. 如果你不一定要在的ImageView 按钮滚动而去,只是删除滚动型

  1. If you don't necessarily want the ImageView and Button to scroll away, just remove the ScrollView:

<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屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆