Android animateLayoutChanges:我可以设置侦听器吗?
我已经为我的Android animateLayoutChanges:我可以设置侦听器吗?,android,animation,layout,Android,Animation,Layout,我已经为我的LinearLayout设置了android:animateLayoutChanges为true: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="top" android:ani
LinearLayout
设置了android:animateLayoutChanges
为true
:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="top"
android:animateLayoutChanges="true">
</LinearLayout>
我怎么知道动画什么时候完成?我也有同样的问题,
这篇文章会对你有所帮助。
首先,使用getLayoutTransition
方法从LinearLayout
获取LayoutTransition
。
然后将TransitionListener
添加到您得到的布局转换中
此方法适用于api级别
11
及以上级别。是否有方法获取转换进度?
TextView line;
...
line.setVisibility(View.GONE);