android - 我不能使用 labelVisibilityMode
解决方案
尝试使用新的material.io 2.0和androidx ..试试这个代码..
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent">
<include
android:id="@+id/amToolbar"
layout="@layout/app_toolbar"
/>
<FrameLayout
android:id="@+id/activity_main_container"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintTop_toBottomOf="@+id/amToolbar"
app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/bottom_menu" />
</androidx.constraintlayout.widget.ConstraintLayout>
请参阅此链接 https://material.io/design/components/bottom-navigation.html
推荐阅读
- r - 在 R 中创建一个三向列联表
- xamarin.forms - 关于 xamarin 表单中的相机设置
- excel - 在 Excel (VBA) 中使用 Vlookup 实现
- python - Geopandas 无法在现有路径上写入文件
- javascript - 根据响应显示图像
- xml - 在 xforms 的重复功能中设置根节点的值
- python - 在大表中添加展开/折叠按钮
- python - 使用最少的 sys.path hack 解决从嵌套文件夹结构导入的问题
- apache - 如何修复 Liferay 7.4.2 中禁止的 URL 重定向?
- cmake - 如何在cmake中对多个文件使用EXCLUDE REGEX