私はv4android互換性ライブラリを使用して、Android2.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();
トランジットアニメーションを使用する代わりに、フラグメントが約1秒間フリーズし、ちょうど消えて新しいフラグメントが表示されます。
使用:
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.1MotorolaXoom、2.3 Galaxy Tab 7 "、2.2エミュレーター、さらには2.3.4のHTCG2でテストしました。
ここで何が間違っている可能性がありますか?