gpt4 book ai didi

ios - 启动 UIImagePickerController 后 TabBar 消失

转载 作者:行者123 更新时间:2023-11-30 13:46:03 24 4
gpt4 key购买 nike

在我的项目中,或者如果您引用附加的 Storyboard,我有一个嵌入在 UINavigationController 中的 UITabBarController,其中 rootview 作为 UIViewController。查看我附加的 GIF,请注意当我单击“从我的图像中选择”时,我的选项卡栏如何消失,而在“取消”后它又如何消失。

我的代码如下:

在我的“从我的图像中选择”按钮内

@IBAction func chooseLibrary(sender: AnyObject) {

let picker = UIImagePickerController()
picker.delegate = self
picker.sourceType = .PhotoLibrary
picker.allowsEditing = true

self.navigationController?.presentViewController(picker, animated: true, completion: nil)
}

在我的“取消”按钮内

func imagePickerControllerDidCancel(picker: UIImagePickerController) {
self.navigationController?.dismissViewControllerAnimated(true, completion: nil)
}

为了以防万一,我还附上了我的 Storyboard。

enter image description here enter image description here

最佳答案

你在这里没有提供足够的信息,那是一个真正的UITabBar和 Controller 吗?如果是这样,有一些设置可以在推送时隐藏,但看起来更像是您只是将 View 放在另一个 View 上?我看不到相关代码,所以我无法判断,但您应该检查 hidesWhenPushed 或类似设置,以确保这些设置符合您的预期。

关于ios - 启动 UIImagePickerController 后 TabBar 消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34927381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com