开发者

Android transition not working on phone

开发者 https://www.devze.com 2023-04-04 07:54 出处:网络
I created some transitions between activities that are working fine in the emulator, but nothing of them can be seen on the phone (neither fade in-out nor slide). The new activity simply appears like

I created some transitions between activities that are working fine in the emulator, but nothing of them can be seen on the phone (neither fade in-out nor slide). The new activity simply appears like I have not implemented any transitions. Why is that?

fadein.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolat开发者_开发知识库or="@android:anim/accelerate_interpolator"
   android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="1000" />   

fadeout.xml

<?xml version="1.0" encoding="utf-8"?>
    <alpha xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="1000" />

And i set in the appropriate activity

 overridePendingTransition(R.anim.fadein, R.anim.fadeout);


Make sure that animations are enabled on device. For this go to Settings->Display->Animations and select "All Animations".


Enable the transition animation

Settings -> Developer Options -> Transition Animation Scale -> 1x


Go to Settigs then developer options and check for the options that are related to animation and assure that each one of animation option is switched on

0

精彩评论

暂无评论...
验证码 换一张
取 消