2016-01-21 92 views
0

在我的項目中,或者如果您參考附加故事板,我有一個UITabBarController嵌入UINavigationController與rootview作爲UIViewController。看看我附加的GIF,注意當我點擊「從我的圖片中選擇」時,我的標籤欄消失,並在「取消」後消失。TabBar在啓動後消失UIImagePickerController

我的代碼如下:

在我的 「選擇從我的圖片」 按鈕

@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) 
} 

我也附上了我的故事板以防萬一。

enter image description here enter image description here

回答

0

你在這裏沒有提供足夠的信息,是一個真正的UITabBar和控制器?如果是這樣,有些設置可以在推送時隱藏,但是看起來更像是將視圖放在另一個視圖上?我看不到相關的代碼,所以我不能告訴你,但你應該檢查隱藏當推或類似的設置,以確保這些是你所期望的。

+0

是的,我拖出一個UITabBarController,並嵌入一個UINavigationController。最後,將UIViewController作爲根視圖。你能否詳細說明如何隱藏壓力可以提供幫助? – jo3birdtalk