2015-06-17 47 views

回答

1

這些轉變是活動,不爲片段,見below from documentation這些是windowExitTransition指定 & windowEnterTransition

<style name="BaseAppTheme" parent="android:Theme.Material"> 
    <!-- enable window content transitions --> 
    <item name="android:windowContentTransitions">true</item> 

    <!-- specify enter and exit transitions --> 
    <item name="android:windowEnterTransition">@transition/explode</item> 
    <item name="android:windowExitTransition">@transition/explode</item> 

    <!-- specify shared element transitions --> 
    <item name="android:windowSharedElementEnterTransition"> 
    @transition/change_image_transform</item> 
    <item name="android:windowSharedElementExitTransition"> 
    @transition/change_image_transform</item> 
</style> 

你可以嘗試實現相同的片段,以及指定的轉變在你的碎片交換

+0

謝謝,但我知道過渡如何做活動。但是,你能向我展示一個帶有fragmenttransanction的例子嗎? –

+0

它看起來像這樣:fragmentTransaction.setCustomAnimations(R.anim.enter_from_right,R.anim.exit_to_left) – Akhil

相關問題