3
私は3.0を使用フラグメントのためのアプリケーションを構築しようとしています交換しません。アプリケーションの左側には静的フラグメントがあり、右側には動的フラグメントがあります。動的部分の私の断片のそれぞれにはタイトルがあります。私が最初の断片を置き換えるたびに、最初のタイトルはまだ最初のタイトルの上に表示されます。連続した置換が下の部分に取って代わりますが、初期のタイトルはまだ表示されています(私はまだ画像を投稿できません)。Androidの断片が正しく
私はイメージのために行うことができますベスト:
初期ヘッダー
新しいヘッダー
コンテンツ(細かい表示)
main.xml:使用
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment
android:id="@+id/static_fragment"
android:name="ruleout.android.History_Fragment"
android:layout_width="500dp"
android:layout_height="match_parent" />
<fragment
android:id="@+id/dynamic_fragment"
android:name="ruleout.android.New_Screen_Fragment"
android:layout_width="fill_parent"
android:layout_height="match_parent" />
</LinearLayout>
部分MainActivityフラグメントを変更する
private void open(Fragment toShow)
{
FragmentTransaction fragmentTransaction = FragMag.beginTransaction();
fragmentTransaction.replace(R.id.dynamic_fragment, toShow);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
ご不明な点がございましたら、お気軽にお問い合わせください。
ご協力いただきありがとうございます。それは素晴らしい作品です。 – cren90