在BottomNavigationView中设置最初选择的项目索引/ID [英] Set initially selected item index/id in BottomNavigationView

本文介绍了在BottomNavigationView中设置最初选择的项目索引/ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了 BottomNavigationView 并且不知道如何设置选择索引或MenuItem id(在我的情况下,默认情况下应选择中间项).

I have implemented BottomNavigationView and have no idea how to set selection index or MenuItem id (in my case, middle item should be selected by default).

恐怕目前还没有这种可能性,因为它太原始了,但是无论如何,我们将不胜感激.谢谢!

I'm afraid there's no such possibility for now as far as it's too raw yet, but anyways any help will be appreciated. Thanks!

推荐答案

使用 Android Support Library 25.3.0开始提供此方法.

This method started being available from Android Support Library 25.3.0.

这篇关于在BottomNavigationView中设置最初选择的项目索引/ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆