android - BottomNavigation 视图中的波纹效果
问题描述
在我的 BottomNavigationView 中,我想添加波纹效果,然后更改我选择的导航项的背景颜色。这是我到目前为止所做的截图
我的可绘制文件
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorAccent" android:state_checked="true"/>
<item android:drawable="@color/colorPrimaryDark" android:state_checked="false"/>
</selector>
我的布局文件
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:itemBackground="@drawable/navigaton_item_bg"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"
app:menu="@menu/navigation" />
解决方案
推荐阅读
- ruby-on-rails - ubuntu 服务器(nginx+passenger+capistrano)上的 Rails 应用程序日志在哪里?
- r - R中的Beta回归模型
- python - Django不呈现表单字段
- soap - 使用失眠症来打肥皂电话
- python - {Python} 如何将字典转换为坐标?
- python - 将绘图树状图应用于文本数据
- r - 确保使用 {mongolite} 读取 MongoDB 数据时数据帧变为 tibbles
- php - 在 Laravel Excel 中插入不存在的数据并拒绝存在的数据
- swift - 状态变量和 ForEach Swift
- javascript - 如何从 asyn/await 函数将值返回给全局变量?