Как поместить скроллвью в этот макет, не конфликтуя с нижней навигацией? - PullRequest
0 голосов
/ 04 октября 2018

Я так много пытался, и я не могу заставить это работать .. Как мне спроектировать этот макет так, чтобы я мог иметь вид прокрутки между панелью приложения и нижней навигацией, не перемещая нижнюю навигацию под видом или имеячасть прокрутки, скрытая за панелью приложения или нижней навигацией?

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

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbarTop"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/white_grey_border_bottom">

        <TextView
            android:id="@+id/appBarLabel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="Lost &amp; Found"
            android:textColor="@color/colorBlack"
            android:textSize="30dp"
            android:textStyle="bold" />
    </android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>


<android.support.design.widget.BottomNavigationView
    android:id="@+id/bottomNavView_Bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true"
    android:background="@drawable/white_grey_border_top"
    app:menu="@menu/bottom_navigation_menu">

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

</RelativeLayout>

1 Ответ

0 голосов
/ 16 октября 2018
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/coordinator_root"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <!-- Add your AppBarLayout and ScrollView here, inside the CoordinatorLayout -->

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

    <android.support.design.widget.BottomNavigationView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</LinearLayout>
...