开发者

LayoutAnimation on a ListView backed by a CursorAdapter

I have a LayoutAnimation defined in XML and set on my ListView XML with android:layoutAnimation, so when the Activity is first created the individual rows animate on layout but when I change the Cursor linked to the CursorAdapter with changeCursor the ListView updates correctly but the rows do not animate. The Cursor is populated on a background thread (h开发者_开发百科owever populating it on the ui thread makes no difference).

How can I get the ListView to run the LayoutAnimation again when the Cursor changes? I have tried invalidateViews and requestLayout, neither of which work.


Extend ListView and CursorAdpater, it will give you much more control over the layout etc by overriding the necessary methods.

Using LayoutAnimationController in code may be preferable to XML android:layoutAnimation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜