如何显示从选项卡栏列表中选定的选项卡栏
我有一个我想要的登录页面,如果用户已经登录,那么他/她可以查看比向未注册用户显示的更多选项卡。这意味着登录用户可以查看更多选项卡。 有人可以给我一些想法吗?
I have one log in page in which I want ,if the user has logged in then he/she can view more tabs than that showing to an unregistered user.It means logged in users can view more tabs.
Can anybody please give me some idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建您的LoginViewController。
如果登录成功,将视图推送到 TabBarController,这是您的根控制器,您可以在这里编写代码。
如果不成功,设置 UIAlerView 让他们知道登录不正确,并提供密码恢复机制。
如果你是从头开始,我建议你先获取 TabBarViewController (rootController) 并准备好一切。然后处理 LoginViewController 并将其推送到 rootController(如果登录成功)。
Create your LoginViewController.
If the login is Successful, push the view to the TabBarController, which is your rootController, and you can code your stuff here.
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).
您可以首先使用
Set,当您的用户未登录时,仅使用所有用户通用的选项卡,然后当用户登录时,使用 setViewControllers:animated: 您将能够添加新的“私有”选项卡。用
animated:YES
添加它们会给你一个很好的动画效果。要自定义选项卡的项目,您可以使用此对象:
如果您需要帮助,请告诉我,我将为您提供更多信息。
You can use
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:
If you need help, just tell me and i will give you more info.