我使用的V4的Android兼容性库开发使用片段专为Android 2.2设备和一个平板UI。片段标准过渡不动画
一切工作,因为它应该,但我不能让任何动画的工作,甚至没有标准的动画。
代码:
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ABCFragment abcFragment = new ABCFragment();
ft.replace(R.id.main_frame_layout_fragment_holder,abcFragment);
ft.addToBackStack(null);
ft.commit();
使用公交动画代替,片段冻结约一秒钟,刚刚消失,新出现一个。
使用:
ft.setCustomAnimations(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
也不起作用。
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.synergygb.mycustomapp"
android:id="@+id/LinearLayout01" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:gravity="bottom">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/main_frame_layout_fragment_holder">
</FrameLayout>
<!-- OTHER FIXED UI ELEMENTS-->
</RelativeLayout>
我读的是自定义动画是在兼容性库打破,但似乎没有人是具有与标准过渡的问题。我已经在3.2.1摩托罗拉XOOM,2.3的Galaxy Tab 7" ,2.2模拟器进行了测试,甚至在同一个2.3.4 HTC G2。
出了什么问题吗?
达尔维克(调试器)给你什么? – IAmYourFaja
你有任何logcat输出给我们吗? –
没什么,这就是为什么我输了。没有错误。 Logcat什么也没有显示。只需定期回调系统,与应用内更改无关。 检查mTransition的值= 4099. 该值由以下项设置: ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); – blindstuff