我可以做一个ListView项不可选? [英] Can I make a ListView item not selectable?

查看:159
本文介绍了我可以做一个ListView项不可选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我采取无休止的ListView(像Twitter的应用程序)。我想打的最后一个项目不selecteble。因此,如果倒数第二个项目被选中,我向下滚动我的轨迹球,没有任何反应。我尝试设置机器人:可调焦=假和android:cickable =假,但我没有看到任何chnage

I am implementing an endless ListView (like in the Twitter app). I want to make the last item not selecteble. So that if the penultimate item is selected and I scroll down with my trackball, nothing happens. I tried setting android:focusable="false" and android:cickable="false" but I didn't notice any chnage.

推荐答案

这是pretty的方便,在您的适配器可以覆盖方法的IsEnabled(INT位置)并返回false为这个项目。

It's pretty easy, in your adapter you can override the method isEnabled(int position) and return false for this item.

这篇关于我可以做一个ListView项不可选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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