简体   繁体   English

在android中更改底部导航栏的项目

[英]Changing items of bottom navigation bar in android

I wanted to add more than 5 items in the bottom navigation but it allows only 5 items.我想在底部导航中添加 5 个以上的项目,但它只允许 5 个项目。 So I thought to add the screen from where user can change the items at the bottom navigation whichever he wants.所以我想添加一个屏幕,用户可以在那里随意更改底部导航中的项目。 I have seen this kind of behaviour in IOS application but haven't seen in any andorid app.我在 IOS 应用程序中看到过这种行为,但在任何安卓应用程序中都没有看到过。 is it possible?是否可以?

You can now add more than 5 tabs , There's an easy way to do it now: Use Support Library 28 and just add app:labelVisibilityMode="labeled" to your BottomNavigationView XML declaration.您现在可以添加 5 个以上的选项卡,现在有一个简单的方法:使用支持库 28 并将app:labelVisibilityMode="labeled"到您的BottomNavigationView XML 声明。 or you can create a custom BottomNavigationView by creating your own XML layout.或者您可以通过创建自己的 XML 布局来创建自定义 BottomNavigationView。 first try below code snippet.首先尝试下面的代码片段。

Try out this solution: Solution试试这个解决方案:解决方案

This exaple also helps you: Exaple这个例子也可以帮助你:例如

Hope this may helps you希望这可以帮助你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM