Animate selector/state transitions

折月煮酒 提交于 2019-12-02 18:48:37

Added in api 21 "StateListAnimator"

http://developer.android.com/reference/android/animation/StateListAnimator.html

I know this is an old question but this may help future people looking to do this.

HatemTmi

I guess TransitionDrawable could help you to accomplish this.

You can check the answer here: Animate change of view background color on Android

Is it the fade you want?

I guess it would be the same as how a textSwitcher works, maybe you want to change it to a ViewSwitcher instead, the fade is done pro-grammatically


Animation in = AnimationUtils.loadAnimation(this,
                android.R.anim.fade_in);
        Animation out = AnimationUtils.loadAnimation(this,
                android.R.anim.fade_out);

        mSwitcher1.setInAnimation(in);
        mSwitcher1.setOutAnimation(out); 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!