2016-11-29 6 views
1

人々を非表示にすることができない私は必死だ助けてください... :-(スウィフト:TabBarにはimagePickerController

私はタブバーの上にモーダルビューを取得するために、これを実行します.... 4つの項目でタブバーを持っています。

私は写真を含むことができ、画像ビューを持っているモーダルで
self.tabBarController?.tabBar.isHidden = true 
self.tabBarController?.tabBar.layer.zPosition = -1 
let modal = self.storyboard?.instantiateViewController(withIdentifier: "NewTripVC") as! NewTripVC 
let navigationController = UINavigationController(rootViewController: modal) 
navigationController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext 
self.present(navigationController, animated: true, completion: nil) 

...私はイメージピッカー

var imagePicker = UIImagePickerController() 

if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.savedPhotosAlbum){ 
    self.imagePicker.delegate = self 
    self.imagePicker.sourceType = UIImagePickerControllerSourceType.savedPhotosAlbum; 
    self.imagePicker.allowsEditing = false 
    self.imagePicker.navigationBar.isTranslucent = false 
    self.present(self.imagePicker, animated: true, completion: nil) 
} 

と、フォトライブラリから画像を選んでいます。そして、私は閉じるためにこれを使用しています.... buビューが閉じているときにトン...タブバーがポップアップしますと、私はこれを試してみました...しかし、これは...働いていません:-(

//this will dismiss the view but also will show tabBar that can't be hidden with any way 
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 
    imagePicker.dismiss(animated: true, completion: nil) 
} 

それを隠すことはできません。

self.tabBarController?.tabBar.isHidden = true 
self.tabBarController?.tabBar.layer.zPosition = -1 

enter image description here

+0

は、あなたが入れてみましたなかったので、ラメ.....これに

navigationController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext 

を変更self.tabBarController?.tabBar.isHidden =真 self.tabBarController?.tabBar.layer.zPosition = -1はimagepickerの完了ブロック内にありますか? – Sreekanth

答えて

0

よく答えは非常に簡単です。

navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen 
関連する問題