我已经实现了我的应用程序底部的导航视图和我看过的每一个地方上的,如图标上方显示的徽章这个 我不知道这是否是甚至有可能实现.任何帮助表示赞赏.谢谢.
我一直在尝试BottomNavigationView在API 25中发布.我想在底部导航栏的其中一个菜单项上显示通知徽章(比如一个带或不带计数的小蓝圈).
我有一个选择器drawable,其中我添加了检查true和检查错误状态与灰色drawable,其上有一个蓝点.当用户导航到其他导航项时,整个菜单按钮变为灰色和徽章.我知道这是因为itemIconTint应用于drawable这是因为具有不同颜色徽章作为图标的一部分将不起作用.有没有其他方法来实现这一目标?
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white"
app:itemIconTint="@color/selector_bottom_nav"
app:itemTextColor="@color/selector_bottom_nav"
android:layout_gravity="bottom"
app:menu="@menu/menu_bottom_nav">
</android.support.design.widget.BottomNavigationView>
Run Code Online (Sandbox Code Playgroud)
这就是我使用它的方式.以itemIconTint编程方式删除和更改图标可用没有帮助.
在Android开发者身上我什么都没找到,而且它也很新,网上也没有.
底部导航栏有自定义库,但我正在寻找官方库的支持.
任何想法,任何人?
我只想补充徽章了menuItem的BottomNavigationView我的应用程序。我使用的BottomNavigationView是材料组件库(版本1.1.0-alpha08),因为它的最新版本是在7天前发布的,所以我没有找到与此相同的任何教程,因为该版本的BottomNavigationView“的showBadge方法,我们不能使用该方法。
我试过了的实例调用getBadge和getOrCreateBadge方法BottomNavigationView。
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
if (bottomNavigationView.getBadge(3) == null) {
audioPlayingCountBadge = bottomNavigationView.getOrCreateBadge(3);
audioPlayingCountBadge.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
} else {
audioPlayingCountBadge = bottomNavigationView.getBadge(3);
}
audioPlayingCountBadge.setVisible(true);
Run Code Online (Sandbox Code Playgroud)
我在android开发中是菜鸟,所以如果有人可以提供详细解决此问题的方法,这将非常感激我。
我想在底部导航视图上设置指示器。您可以看到底部的橙色线
如何设置指示器?

我没有找到任何指标示例。
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/bottom_navigation_bg"
app:labelVisibilityMode="unlabeled"
app:menu="@menu/bottom_menu_main"/>
Run Code Online (Sandbox Code Playgroud)