【发布时间】:2018-11-07 12:20:30
【问题描述】:
我目前正在使用 Fab 和 BottomNavigationView。我想要的是像这样将两者结合在一起
这是我尝试过的代码,看起来不太好
<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.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center|bottom"
android:layout_marginBottom="46dp" />
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimaryDark"
app:menu="@menu/nav_items"></android.support.design.widget.BottomNavigationView> </RelativeLayout>
非常感谢任何指导。
【问题讨论】:
-
您好,您的意思是 Fab 与导航重叠?
-
其实是自定义导航栏
标签: android android-layout android-bottomnav floating-action-button