ListView长按动画
我想在 ListView 中捕获长单击事件,这可以使用 OnItemLongClickListener 轻松完成。但是,这缺少选择器过渡到长按时的淡入淡出动画,当长按由 onCreateContextMenu 处理时会看到这种动画。如何使用 OnItemLongClickListener
获取该动画?
I would like to capture long click events in a ListView, which was easily done using a OnItemLongClickListener. However, that lacks the fading animation of the selector transitioning to a long press that is seen when the long click is handled by onCreateContextMenu. How can I get that animation using OnItemLongClickListener
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保封闭列表项的视图指定:
Make sure the enclosing list item's view specifies:
我遇到了同样的问题,并通过删除我的行的 LinearLayout 中的以下属性来解决它:
删除该属性或将值设置为 false 都解决了问题。
I was having the same problem and resolved it by removing the following property in the LinearLayout for my rows:
Removing that property or setting the value to false both fixed the problem.