开发者

How to programmatically change views in TabBarViewController?

I have two instances where I want to re-direct the user to the main view of a TabBarViewController. I've tried BringSubViewToFront(), but that does nothing... I basical开发者_StackOverflow社区ly want to activate the first tab (home tab?).


Assuming your TabViewController already has all the ViewControllers created for each tab, simply changing the SelectedIndex property in the tabbar does what you're looking for:

myTabBarController.SelectedIndex = 2;

Will send you to the third tab (array is zero-based).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜