我目前的应用程序有片段slidingUpCard导航。他们中的每个人都有一套不同的活性动作条
元素和按钮与屏幕变化。我想知道是否有动画效果的按钮来来往往类似的方式是什么安卓animateLayoutChanges
会做一个的LinearLayout
。
My current app has fragment and slidingUpCard navigation. Each one of them has a different set of active ActionBar
elements and the buttons change with the screen. I was wondering if there was a way of animating the buttons coming and going similar to what android:animateLayoutChanges
would do for a LinearLayout
.
在你的问题。我不知道是否有可能加入 animateLayoutChanges
到 ActionBarContainer 持有的动作条
。但你仍然可以访问 ActionBarView
以同样的方式,你会看到一个有点倒在这个答案。
On your question. I'm not sure if it is possible to add animateLayoutChanges
to the ActionBarContainer that holds the ActionBar
. But still you can access the ActionBarView
in same manner as you will see a bit down in this answer.
层次: ActionBarContainer
- > ActionBarView
- > AbsActionBarView
- > 的ViewGroup
Hierarchy: ActionBarContainer
-> ActionBarView
-> AbsActionBarView
-> ViewGroup
理念:
看看这个依据,看看菜单项进行访问,并引用为查看
Take a look at this gist and see how menu items are accessed and referenced as View
下一篇:
隐藏所有菜单项,但得到他们的图标资源或整个查看
您在要点见。
使用 ObjectAnimator
或 ViewPropertyAnimator
动画的 X
的进出。
请注意,这是肮脏的方式。它可以是缓慢的,因为反射。
Note that this is dirty way. It can be slow due to the reflection.