0
2つのLinearLayoutsを子として持つLinearLayoutを含むAppBarLayoutを持つCoordinatorLayoutがルートにあります。これらの子レイアウトAとBを呼んでみましょう.AとBの両方の内容を同時に表示することはできません。 AのコンテンツとBのコンテンツは削除されず、Aのコンテンツのみを削除すると、Bのコンテンツが表示され、その逆もあります。これは、LinearLayoutコンテナの内部にAとBの両方の内容がある場合のように見えます。CoordinatorLayoutが2つの子レイアウトで正常に動作しない
AとBの両方がショーのTextviewsだけのTextViewを有し、Bはありません。ここで
は、レイアウトのためのコードです:
<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/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<LinearLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffff"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/A"
android:padding="10dp">
<TextView
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/title"
android:textColor="#000000"
android:fontFamily="sans-serif-light" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/B"
android:background="@drawable/border"
android:padding="10dp">
<TextView
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textview"
android:textColor="#000000"
android:fontFamily="sans-serif-light" />
</LinearLayout>
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
私はすべてを試してみましたが、私は間違っているかを把握することはできません。スクロールの動作はうまくいきますが、AとBの両方の内容を見ることはできません。 誰かが助けることができますか?