从 UITabBarController 场景转到 ViewController 并返回 "hides" UITabBar
Segue to ViewController from UITabBarController Scene and back "hides" UITabBar
所以我的应用目前有问题。所以我有一个有 2 "pages" 的 UITabBarController。第一页名为 AddExpense(它的 class 是 AddExpenseViewController),有一个按钮可以连接到一个场景,叫做 PicExpense(它的 class 是 PicExpenseViewController),它没有与 UITabBarController 链接。不过,我遇到的问题是,当我尝试从 PicExpenseViewController BACK TO 继续 AddExpenseViewController 时。我目前正在使用此代码返回 :
performSegueWithIdentifier("segueBackToAddExpense", sender: nil)
这工作正常,但 UITabBar 被隐藏了。这是我的 StoryBoard 的图片,以供参考我正在使用的内容:StoryBoard image here,请注意,只有 AddExpense 和 Receipt Picture View Controller 与此问题相关,但如果有人有兴趣查看所有内容为了他们的回答或帮助我,我把整个事情拍了下来。
我对同样的问题做了一些研究,但我已经尝试了那些答案,比如 StoryBoard 中视图的属性检查器上的 "Hide Bottom Bar On Push" CheckBox。 Here is the Attributes Selector View 我的 StoryBoard 文件中的收据图片视图控制器。
提前致谢
试试这个,如果有效请告诉我。
segue.destinationViewController.hidesBottomBarWhenPushed = true
您也可以在 Attributes
下的 Storyboard/XIB 中进行设置。
也许,你可以用- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated;
或- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion
代替performSegueWithIdentifier("segueBackToAddExpense", sender: nil)
回答:@WilsonXJ 找到了我的问题的答案。我使用的是普通 "Show" Segues,但我需要使用 "Unwind Segue"。
所以我的应用目前有问题。所以我有一个有 2 "pages" 的 UITabBarController。第一页名为 AddExpense(它的 class 是 AddExpenseViewController),有一个按钮可以连接到一个场景,叫做 PicExpense(它的 class 是 PicExpenseViewController),它没有与 UITabBarController 链接。不过,我遇到的问题是,当我尝试从 PicExpenseViewController BACK TO 继续 AddExpenseViewController 时。我目前正在使用此代码返回 :
performSegueWithIdentifier("segueBackToAddExpense", sender: nil)
这工作正常,但 UITabBar 被隐藏了。这是我的 StoryBoard 的图片,以供参考我正在使用的内容:StoryBoard image here,请注意,只有 AddExpense 和 Receipt Picture View Controller 与此问题相关,但如果有人有兴趣查看所有内容为了他们的回答或帮助我,我把整个事情拍了下来。
我对同样的问题做了一些研究,但我已经尝试了那些答案,比如 StoryBoard 中视图的属性检查器上的 "Hide Bottom Bar On Push" CheckBox。 Here is the Attributes Selector View 我的 StoryBoard 文件中的收据图片视图控制器。
提前致谢
试试这个,如果有效请告诉我。
segue.destinationViewController.hidesBottomBarWhenPushed = true
您也可以在 Attributes
下的 Storyboard/XIB 中进行设置。
也许,你可以用- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated;
或- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion
代替performSegueWithIdentifier("segueBackToAddExpense", sender: nil)
回答:@WilsonXJ 找到了我的问题的答案。我使用的是普通 "Show" Segues,但我需要使用 "Unwind Segue"。