我在bottomappbar 内使用bottomnavigationview 以便我的bottomappbar 用作曲线背景,而bottomnavigationview 会查找tabbuttons 但问题是即使我在widht 中使用匹配父级后它也不适合。下面我给出了同样问题的图像,你可以看到它在起始端有间隙。
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="110dp"
android:theme="@style/bottomnavigationbutton"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottonappbar"
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_gravity="bottom">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="@drawable/gradient"
app:menu="@menu/navigation_bottom" />
</com.google.android.material.bottomappbar.BottomAppBar>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingactionbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabCustomSize="75dp"
app:layout_anchor="@id/bottonappbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
--谢谢