0
CoordinatorLayoutにフラグメントを追加できないようです。挿入しようとすると、何もクラッシュすることはありませんが、断片は表示されませんが、次元を評価するとゼロ以外の値になります。 CoordinatorLayout
をRelativeLayout
に変更すると、フラグメントが表示されます。 CoordinatorLayout
にEditText
を追加すると、EditText
が表示されます。 CoordinatorLayout
にフラグメントが表示されないのはなぜですか?CoordinatorLayoutにフラグメントを追加します
次のように私のXMLは次のとおりです。
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.mypackage.Behavior">
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
次のように私は私の断片とFrameLayout
を交換しています。私の場合は
getChildFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container, myFragment, MyFragment.TAG)
.commit();
あなたはその動作を表示できますか? – GPack
@GPack今は空です。 – Zarwan