项目单击上的ListView动画错误 [英] ListView animation bug on item click

查看:70
本文介绍了项目单击上的ListView动画错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个listview,并且有onitemclick侦听器.连续有一个框架布局,里面有两个视图.我想做的是,当我单击该项目时,第一个布局随动画一起滑落,以显示下面的第二个.我这样做了,但是我的问题是有时它可以工作,有时却不行.大多数情况下,滚动后即可使用.我一直在找我几个小时的错误,所以如果有人有一个主意,那就太好了:)

i've got a listview in my app and i've got an onitemclick listener on it. In a row there is a framelayout and there are two view inside. what i want to do is, when i click on the item, the first layout slide away with an animation to show the second one which is below. I did this, but my problem is that sometimes it works and sometimes not. Most of the time it works after scrolling. I'm looking for my mistake for hours, so if someone have an idea, it will be great :)

谢谢

推荐答案

我找到了它.为避免此类问题,请不要在列表视图上使用"wrap_content"属性.我对其进行了测试,并且可以正常工作!

I found it. To avoid this kind of problem, do not use the "wrap_content" property on your listview. I tested it, and it works !

这篇关于项目单击上的ListView动画错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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