ActivityOptions.makeSceneTransitionAnimation doesn't seem to exist

后端 未结 3 1383
南笙
南笙 2020-12-30 13:30

Android L introduced a new animations feature: animating between similar Views in different activities. It\'s documented here.

I\'ve tried to use ActivityOpti

3条回答
  •  Happy的楠姐
    2020-12-30 14:28

    Okay, I got it working.

    It seems like setting the value in styles.xml is completely ignored for now.

    You'll need to do this in each Activity's onCreate till that's fixed

    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    Transition transition = // load transition here.
    getWindow().setSharedElementEnterTransition(transition);
    getWindow().setSharedElementExitTransition(transition);
    

    As per the same bug ViewAnimationUtils has, you'll see errors in Android Studio, it'll compile and run fine though.

提交回复
热议问题