Starting an app with a Tab View and no tabs selected?
I'm developing an iPhone app with Objective-C and iOS SDK with a tab view on the bottom. I want to make the 开发者_开发问答app so that when it first loads up, the tabs are on the bottom, but none of them are selected. Instead, the user is presented with a "home" view, and can select the tabs from there if he / she desires.
How would I make this work? I'm assuming it's something in the App Delegate?
Thanks!
I did this recently. Just do
[self.myTabBar setSelectedItem:nil];
Works perfectly, no tabs should be selected. Let me know if you have any problems. Also, just put that in either - (void) viewDidLoad or initWithNibName .
I think this would be something that's appropriate to fake.
I would:
- Add a subview that overlays the area normally occupied by the selected tab view.
- Add UITabBarControllerDelegate tabBarController:shouldSelectViewController that will hide/remove that view.
The only remaining problem is to make the actually selected tab button seem unselected until the subview is hidden.
精彩评论