0

我已经尝试了这么多,但我无法让它工作..我如何设计这个布局,以便我可以在 appbar 和底部导航之间有一个滚动视图,而无需移动视图下方的底部导航或有一部分隐藏在应用栏或底部导航后面的滚动视图?

<?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>
4

1 回答 1

0
<?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>
于 2018-10-15T22:05:04.163 回答