Programmatically selected tab doesn't show hightlight overlay
I'm trying to programmatically switch tabs. I tried to do this using the following calls:
tabBarC开发者_如何学运维ontroller.selectedIndex = 2;
tabBarController.selectedViewController = checkinViewController;
In both cases, This is what I get:alt text http://cl.ly/1Gia/content
This is what I want:
alt text http://cl.ly/1GKE/content Any clue?Assigning a new view controller to this property changes the currently displayed view and also selects an appropriate tab in the tab bar. Changing the view controller also updates the selectedIndex property accordingly.
Maybe just try without the selectedIndex
? Also, is there a fourth tab item in there? If there's only 3, then selectedIndex = 2 would be the more button and:
Attempting to set this value to an index of a view controller that is not visible in the tab bar, but is instead managed by the More navigation controller, has no effect.
Some thoughts, not sure if this is the answer.
精彩评论