开发者

Starting an app with a Tab View and no tabs selected?

开发者 https://www.devze.com 2023-02-17 06:10 出处:网络
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 t

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.

0

精彩评论

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

关注公众号