从UITabBarController场景中查看ViewController并返回"隐藏" UITabBar

时间:2016-06-22 00:49:00

标签: ios xcode swift uitabbarcontroller segue

所以我的应用程序目前有问题。所以我有一个UITabBarController有2"页"。第一个页面名为AddExpense(它的类是AddExpenseViewController),它有一个按钮,它被分隔到一个名为PicExpense(它的类是PicExpenseViewController)的场景,它没有与UITabBarController链接。我遇到的问题是,当我尝试从PicExpenseViewController 返回中添加AddExpenseViewController时。我目前正在使用此代码来反驳:

performSegueWithIdentifier("segueBackToAddExpense", sender: nil)

这很好用,但UITabBar是隐藏的。这是我的StoryBoard的图片,供我参与的参考:StoryBoard image here,请注意,只有AddExpense和Receipt图片视图控制器在这个问题中是相关的,但是如果有人有兴趣看到它的全部内容为了他们的答案或帮助我,我拍了整张照片。

我对同一个问题进行了一些研究,但我已经尝试过像#34; Hide Bottom Bar On Push" StoryBoard中视图的属性检查器上的CheckBox。我的StoryBoard文件中的收据图片视图控制器的Here is the Attributes Selector View

提前致谢

3 个答案:

答案 0 :(得分:1)

答案:@WilsonXJ找到了我的问题的答案。我使用普通的“Show”Segues,但我需要使用“Unwind Segue”。

答案 1 :(得分:0)

试试这个,让我知道它是否有效。

segue.destinationViewController.hidesBottomBarWhenPushed = true

您也可以在Attributes下的Storyboard / XIB中设置此内容。

答案 2 :(得分:0)

也许,您可以使用- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated;- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion来替换performSegueWithIdentifier("segueBackToAddExpense", sender: nil)