动画的动作出现在片段的变化栏图标 [英] Animating action bar icons appearing on fragment changes

查看:121
本文介绍了动画的动作出现在片段的变化栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的应用程序有片段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 到<一个href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.0.1_r1/com/android/internal/widget/ActionBarContainer.java#ActionBarContainer"相对=nofollow> 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

下一篇:

  1. 隐藏所有菜单项,但得到他们的图标资源或整个查看您在要点见。

使用 ObjectAnimator ViewPropertyAnimator 动画的 X 的进出。

请注意,这是肮脏的方式。它可以是缓慢的,因为反射。

Note that this is dirty way. It can be slow due to the reflection.

这篇关于动画的动作出现在片段的变化栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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