CoordinatorLayout分为两个相等的部分

时间:2016-11-18 14:12:02

标签: android android-layout android-coordinatorlayout

我想将我的布局分成两个相等的部分,一个是Imageview,另一个是Recyclerview,两个都包含在CoordinatorLayout中。 由于某些原因,这不起作用,滚动回收器视图不会滚动图像,任何想法?

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFF"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <ImageView
                android:id="@+id/mPreview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:contentDescription="@string/preview_iv"
                android:elevation="4dp"
                app:layout_scrollFlags="scroll|enterAlways"/>

        </android.support.design.widget.AppBarLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/mGalleryRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

    </LinearLayout>

</android.support.design.widget.CoordinatorLayout>

0 个答案:

没有答案
相关问题