【Android】解決底部導航tab遮擋其他view的問題
阿新 • • 發佈:2018-12-23
<?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:id="@+id/container"
android:layout_width="match_parent"
android: layout_height="match_parent"
tools:context=".activitys.MainActivity">
<FrameLayout
android:id="@+id/main_container_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/navigation" //設定在導航欄上面
/ >
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentBottom="true" //設定在父元件底部
android:layout_alignParentStart="true"
android: background="?android:attr/windowBackground"
app:menu="@menu/navigation" />
</RelativeLayout>