这是我取得的成就:
首先使用最新的支持库编译“com.android.support:design:$SUPPORT_VERSION”
它只适用于你设置白色背景颜色android:background =“@ android:color / white”
请注意,如果您使用app:itemBackground属性,或者您的设计是:itemBackground =“…”,则涟漪效应将消失,因此请将其删除.
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/white"
app:elevation="16dp"
app:itemIconTint="@drawable/nav_item_color_state"
app:itemTextColor="@drawable/nav_item_color_state"
app:menu="@menu/bottom_navigation_main" />
处理启用/禁用状态:
您需要创建选择器文件:
如果你想在AppTheme中改变标准的灰色波纹效果改变colorControlHighlight proproperty,那么它看起来如下:
@color/colorPrimary
@color/colorPrimaryDark
@color/colorAccent
@color/colorPrimaryRipple
使用26%alpha的彩色涟漪.
#3F51B5
#423F51B5