设置 onclicklistener 时禁用 ICS ListView 背景
我正在使用 ListView/GridView 开发 Android 应用程序。
由于我在 ConvertView (我在适配器的 getView() 方法中返回的视图)上设置了 onClickListener,因此按下时单元格的背景不再发光。 我知道我可以在我的 xml 布局文件(值为“background”)中设置我自己的可绘制对象(具有特定的按下状态),但我想保留原始的(就像没有设置 onClickListener 时一样)。
有人可以告诉我如何保留原始背景(按下状态,...)?
谢谢
PS:抱歉我的英语不好,我是法国人
I'm working on an Android application with ListView/GridView.
Since I set an onClickListener on the convertView (The view I return in the getView() method of my Adapter), the cell's background doesn't shine anymore when pressed.
I know I can set my own drawable (with a specific pressed state) in my xml layout file (with value 'background') but I'd like to keep the original one (like when no onClickListener is set).
Can somebody tell me how I can keep the original background (with pressed state, ...)?
Thank you
PS: Sorry for my poor English, I'm French
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它是 Adapter 视图,为什么不添加 OnItemClickListener ?
If its an Adapter view, why don't you add OnItemClickListener ?.