Change the selected TabBar index on button click

前端 未结 4 445
抹茶落季
抹茶落季 2021-01-29 11:27

In my app I have 4 tabs, on the first Tab : I have 4 views. on second view,there is one button which will open the third tab view. But my selected tab Index is One. How can I ch

4条回答
  •  天涯浪人
    2021-01-29 11:59

    The simplest way to programatically switch tabs within the app is by doing this ..

    [self.tabBarController setSelectedIndex:3];
    

    I use this in one of my apps and it works extremely well.

    Plasma

提交回复
热议问题