ListView animation bug on item click

2019-08-31 03:14发布

问题:

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 :)

thanks

回答1:

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 !