Set selected item in Android BottomNavigationView

前端 未结 21 2378
谎友^
谎友^ 2020-11-27 14:16

I am using the new android.support.design.widget.BottomNavigationView from the support library. How can I set the current selection from code? I realized, that

21条回答
  •  情话喂你
    2020-11-27 15:06

    I you don't want to modify your code. If so, I recommended you to try BottomNavigationViewEx。

    You just need replace call a method setCurrentItem(index); and getCurrentItem()

    Click here to view the image

提交回复
热议问题