列表与详细视图重叠

时间:2018-09-26 09:41:24

标签: android xamarin.android

列表与视图重叠有一点问题。我的视图应该在RecyclerView.MvxRecyclerView下面,但是对此我没有什么问题。 有人知道应该怎么做吗?

<android.support.design.widget.CoordinatorLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:stateListAnimator="@animator/shadow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:contentScrim="@color/white"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:toolbarId="@+id/toolbar">


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

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

    <MvvmCross.Droid.Support.V4.MvxSwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/app_bar"
       >

        <MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView
            android:id="@+id/recyclerDetailsView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:choiceMode="singleChoice"
            android:divider="@null"
            android:dividerHeight=""
            android:scrollbars="none"
            app:MvxBind="ItemsSource TimelineTrips"
            app:MvxTemplateSelector="@string/list" />
    </MvvmCross.Droid.Support.V4.MvxSwipeRefreshLayout>

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

1 个答案:

答案 0 :(得分:0)

只需移动到另一个xml

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:stateListAnimator="@animator/shadow"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:contentScrim="@color/white"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:toolbarId="@+id/toolbar"></android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>


//content_main xml

<MvvmCross.Droid.Support.V4.MvxSwipeRefreshLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/app_bar">

    <MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView
        android:id="@+id/recyclerDetailsView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:choiceMode="singleChoice"
        android:divider="@null"
        android:dividerHeight=""
        android:scrollbars="none"
        app:MvxBind="ItemsSource TimelineTrips"
        app:MvxTemplateSelector="@string/list" />
</MvvmCross.Droid.Support.V4.MvxSwipeRefreshLayout>