登录后的标签栏-为什么看起来像这样? [英] Tab bar after login - Why does it look like this?
问题描述
所以我正在写这个应用程序,在整个注册/登录部分之后,我需要在其中有一个标签栏.我环顾四周,看不到有人向我解释如何执行此操作或其原因:当我放置选项卡栏控制器时,它没有任何实际按钮出现,并且该如何将应用程序连接到选项卡蝙蝠控制器?无论哪种方式,这就是我的主要问题.我想念什么吗?谢谢!
so I'm writing this app where I need to have a tab bar after the whole sign up/login part. I've looked around and I dont see anyone explaining me how to do this or why its happening: when I put the tab bar controller, it appears with no actual buttons, and also how should I connect the app to the tab bat controller? Either way, thats my main question. Am I missing something? Thank you!
推荐答案
我也已经开发了使用UITabBarController的应用程序,该应用程序也面临着如何实现附加登录和注册视图控制器的困难.
i have also been developed the application using UITabBarController faced same difficulty how to implement attach login and signup view controller.
通过一些工作,我终于能够实现我并不是说这是完美的方法,但是我正在那样使用,
by few work around i finally able to achieve that i don't say it is the perfect way but i am using like that,
步骤 做两个Stroyboard 1.登录滑板
steps make two Stroyboard 1.login.Stroyboard
2main.Stroyboard
2main.Stroyboard
3.now现在在homeviewcontroller.swift上,这是uitabbarcontroller的第一个标签
3.now on homeviewcontroller.swift which is first tab of uitabbarcontroller
override func viewDidAppear(animated: Bool) {
guard (NSUserDefaults.standardUserDefaults().objectForKey(USER_INFO) != nil) else {//check user is logged in or not
//if user is not logged in present login.storyboard and do the logic there
let storyboard = UIStoryboard(name: "Login", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("LoginViewController") as UIViewController
target.presentViewController(controller, animated: true, completion: nil)
return
}
4.成功登录或注册成功后,请在loginviewcontroller和signupviewcontroller中关闭您的login.storyboard
4. in loginviewcontroller and signupviewcontroller after sucessfull login or signup dissmiss your login.storyboard
self.dismissViewControllerAnimated(true) { () -> Void in
}
5.here项目链接- https://drive.google.com/file/d/0B7APKZanPpc3OW92bzQ5QnRXdVU/view?usp = sharing
5.here the link of project - https://drive.google.com/file/d/0B7APKZanPpc3OW92bzQ5QnRXdVU/view?usp=sharing
这篇关于登录后的标签栏-为什么看起来像这样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!