presentViewController black background instead of transparent

后端 未结 5 924
栀梦
栀梦 2021-01-18 03:24

I have a view that I wish to present to the user in the standard way (sliding up from the bottom of the screen). About half this view is a transparent background and the bot

5条回答
  •  青春惊慌失措
    2021-01-18 03:55

    Using SWIFT 4, just add this code to the view controller you want to have a transparent background.

    override func viewDidLoad()
    {
        super.viewDidLoad()
        self.modalPresentationStyle = .overFullScreen
        self.view.backgroundColor = UIColor.clear
    
    }
    

提交回复
热议问题