Change activity transition when inside a TabHost

前端 未结 2 331
南旧
南旧 2021-01-03 17:00

I have successfully changed the transitions between activities using overridePendingTransition().

Unfortunately when I am on a TabActivity

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-03 17:38

    I had a similar problem with calling overridePendingTransition() from within a Fragment, because Fragments do not have overridePendingTransition() method defined.

    I solved it using:

    getActivity().overridePendingTransition(R.anim.enterAnim, R.anim.exitAnim);
    

    Hope it helps. The Fragment was within a TabHost.

提交回复
热议问题