开发者

How to have a consistent TabBar throughout the life an iPhone application

开发者 https://www.devze.com 2023-02-10 04:51 出处:网络
Im am trying to figure out how to have a consistent TabBar throughout the life of application. To explain, I have MyAppDelegate with its main window, then a UITabBarController with a TabBarView set to

Im am trying to figure out how to have a consistent TabBar throughout the life of application. To explain, I have MyAppDelegate with its main window, then a UITabBarController with a TabBarView set to the window. Now I want to display menus, tables, images, etc; switching views in the main view, while the TabBar stays on top of it all throughout (ie switching views) and ultimately have the TabBar and its items act like an interrupt, so once touched the program will automatically stop what it was d开发者_如何学运维oing and display the "touched" TabBar view.

Thank you


What you are describing is exactly the behavior that UITabBarController gives you. Well, almost. It is up to you to make any long-running code "stop what it was doing" when the tab bar switches tabs. You can set one of your classes to be the UITabBarController's delegate and track the changes from tab to tab:

delegate The tab bar controller’s delegate object.

@property(nonatomic, assign) id delegate Discussion You can use the delegate object to track changes to the items in the tab bar and to monitor the selection of tabs. The delegate object you provide should conform to the UITabBarControllerDelegate protocol. The default value for this property is nil.

0

精彩评论

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