Android MvxExpandableListView上的覆盖工具栏

Android MvxExpandableListView上的覆盖工具栏,android,xamarin.android,mvvmcross,Android,Xamarin.android,Mvvmcross,通过切换按钮,可以使axml文件中的工具栏可见/不可见。数据显示在MvxExpandableListView中。一旦列表视图出现,工具栏就会出现在后面。如何从axml或Viewmodel将工具栏设置为始终位于前端 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local=

通过切换按钮,可以使axml文件中的工具栏可见/不可见。数据显示在MvxExpandableListView中。一旦列表视图出现,工具栏就会出现在后面。如何从axml或Viewmodel将工具栏设置为始终位于前端

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/ListViewRelativeLayout">
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        local:MvxBind="Visible IsNotificationBarVisible">
        <ImageView/>
        <LinearLayout>
        <TextView/>
        <TextView/>
        </LinearLayout>
        <ImageView/>
    </android.support.v7.widget.Toolbar>
    </RelativeLayout>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
android:id="@+id/ListViewRelativeLayout">
        <TextView/>
        <MvxExpandableListView />
    </LinearLayout>

</RelativeLayout>

您的布局过于复杂。如果您只需要将视图彼此重叠,可以使用
框架布局
FrameLayout
中最后定义的视图将位于顶部。比如: