Android 如何更改底部导航视图顶部的线条颜色
我想为底部导航视图设置背景色为白色。但是有一个顶部阴影Android 如何更改底部导航视图顶部的线条颜色,android,background-color,bottomnavigationview,Android,Background Color,Bottomnavigationview,我想为底部导航视图设置背景色为白色。但是有一个顶部阴影 我想换一下这个颜色。如何执行此操作?无法更改框架提供的立面阴影的颜色,但您可以使用库来执行此操作,请参阅 无法更改框架提供的立面阴影的颜色,但您可以使用库进行更改,请参阅 尝试设置app:elevation=“0dp”。它应该消除阴影 <android.support.design.widget.BottomNavigationView android:id="@+id/bottomBar" android:lay
我想换一下这个颜色。如何执行此操作?无法更改框架提供的立面阴影的颜色,但您可以使用库来执行此操作,请参阅
无法更改框架提供的立面阴影的颜色,但您可以使用库进行更改,请参阅
尝试设置
app:elevation=“0dp”
。它应该消除阴影
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:menu="@menu/bottom_menu"
app:elevation="0dp"/>
然后拍摄一张带有彩色阴影的9面片图像,并将其设置为背景尝试设置
app:elevation=“0dp”
。它应该消除阴影
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:menu="@menu/bottom_menu"
app:elevation="0dp"/>
然后拍摄一张带有彩色阴影的9面片图像,并将其设置为背景使用代码
在drawable中创建shadow.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#757575"
android:endColor="@android:color/transparent"
android:angle="90"/>
</shape>
在布局xml中调用此函数
<View
android:background="@drawable/dgb"
android:layout_width="match_parent"
android:layout_height="@dimen/_8sdp"/>
使用代码
在drawable中创建shadow.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#757575"
android:endColor="@android:color/transparent"
android:angle="90"/>
</shape>
在布局xml中调用此函数
<View
android:background="@drawable/dgb"
android:layout_width="match_parent"
android:layout_height="@dimen/_8sdp"/>
我不想移除阴影。我想改变它的颜色。用你的彩色阴影拍摄一张9面片图像,并将其设置为背景。我不想移除阴影。我想改变它的颜色。用你的彩色阴影拍摄一张9面片图像,并将其设置为背景