禁用的ListView滚动 [英] Disable ListView scrolling
问题描述
我要显示一个配置文件屏幕为我的用户。
I want to show a Profile screen for my users.
它必须有三个视图(2 按钮
和的ImageView
)和的ListView
来显示由该用户所进行的内容。
It must have three views (2 Buttons
and a ImageView
) and a ListView
to show the content made by that user.
不过,我不希望的ListView
滚动。相反,我想因为需要它一样大,并且把里面我所有的意见滚动型
,因此三个第一的观点滚动脱离与 ListView控件
。此,当然,并不如预期工作。
However, I don't want the ListView
to scroll. Instead, I want it to be as big as needed, and to put all my views inside a ScrollView
, so the three first views scroll out with the ListView
. This, of course, does not work as intended.
我所有的三个项目是的LinearLayout
里面。我想使他们的第一个项目,在的ListView
的,但是这将导致它们被选择为第一个项目,而不必做一些不必要的编码。
All my three items are inside a LinearLayout
. I thought of making them the first item in the ListView
, but this leads to them being selectable as the first item, and having to do some unneeded coding.
有没有办法做到这一点最简单的方式,否则我将不得不坚持使布局的第一个项目在我的ListView?
Is there a way to do this the easy way or will I have to stick with making the Layout the first item in my ListView?
推荐答案
将它们添加到ListView控件作为第一个项目看起来像pretty的很好的解决方案。
Adding them to the ListView as first Item seems like a pretty good solution.
若要查看不可选择刚才得到的观点和 .setClickable(假)
。
To make the View unselectable just get the view and .setClickable(false)
.
这篇关于禁用的ListView滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!