是否可以在android中设置底部导航栏的顶部边框,如果可能的话请告诉我如何做到这一点,我正在使用android的新底部导航视图。这是我的代码
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentTop="true">
<include
android:id="@+id/gamebar"
layout="@layout/gamebar_layout"
/>
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_layout" />
</LinearLayout>
<!-- Let's add fragment -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/app_bar_layout"
android:layout_above="@+id/bottom_navigation"
android:id="@+id/contentContainer"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
app:itemBackground="@color/BottomNavigationBgColor"
app:itemIconTint="@color/CelestialBlue"
app:itemTextColor="@color/CelestialBlue"
app:menu="@menu/bottom_navigation_main" />
</RelativeLayout>
您可以尝试以下操作:添加一个View
上面的元素BottomNavigationView
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_above="@+id/bottom_navigation"
android:background="#000000"></View>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
app:itemBackground="@color/BottomNavigationBgColor"
app:itemIconTint="@color/CelestialBlue"
app:itemTextColor="@color/CelestialBlue"
app:menu="@menu/bottom_navigation_main" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)