Наложение панели инструментов через MvxExpandableListView - PullRequest
0 голосов
/ 17 сентября 2018

Панель инструментов в моем файле 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>

1 Ответ

0 голосов
/ 17 сентября 2018

Вы слишком усложнили свой макет.Если вам просто нужно наложить виды друг на друга, вы можете использовать FrameLayout.Последнее определенное представление в FrameLayout будет сверху.Так что-то вроде:

<FrameLayout
    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">
    <MvxExpandableListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        ... />
    <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">
</FrameLayout>
...