开发者

How to display selected tab bars from a list of tab bars

I have one log in page in which I want ,if the user has logged in then he/she can view more 开发者_StackOverflow社区tabs than that showing to an unregistered user.It means logged in users can view more tabs. Can anybody please give me some idea?


  1. Create your LoginViewController.

  2. If the login is Successful, push the view to the TabBarController, which is your rootController, and you can code your stuff here.

  3. If it is not successful, set UIAlerView letting them know that Login was incorrect, and provide mechanism for password recovery.

If you are starting from Scratch, I suggest that you get the TabBarViewController (rootController) first and get everything ready. Then work on the LoginViewController and just push it to the rootController (if the login is successful).


You can use

- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated

Set at first, when your user is not logged in, only the tabs common for all users, then when the user logs in, with setViewControllers:animated: you will be able to add the new and "private" tabs. Adding them with animated:YES will give you a nice animated effect. To customize your Tab's items, you can use this objects:

@property(nonatomic, retain) UITabBarItem *tabBarItem

If you need help, just tell me and i will give you more info.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜