Black screen after presenting modal view controller in current context from UITabBarController

后端 未结 9 1703
终归单人心
终归单人心 2020-12-04 18:53

My root view controller is a UITabBarController. I\'m trying to present a modal view controller over one of the tab bar controller\'s view controllers, but still allow the

9条回答
  •  时光说笑
    2020-12-04 19:44

    i had this problem : when i present my ModalController it takes transparent background and when i changed the tab to next one in tabBarController and getBack to previous one the transparent background was gone and and there is a bad black background after research i found the point the point is this:

    self.definesPresentationContext = true

    the self is not modal controller self is that presenting controller for modalController and another point is .overCurrentContext like this

    self.definesPresentationContext = true
            modalController.modalPresentationStyle = .overCurrentContext
            self.present(modalController, animated: true, completion: nil)
    

提交回复
热议问题