iPhone - UIWindow rotating depending on current orientation?

前端 未结 5 2100
甜味超标
甜味超标 2020-12-07 17:17

I am adding an additional UIWindow to my app. My main window rotates correctly, but this additional window I have added does not rotate.

What is the best way to rota

5条回答
  •  甜味超标
    2020-12-07 17:18

    You can set the rootController for your UIWindow. e.g:

    fileprivate(set) var bottonOverlayWindow = UIWindow()
    
    self.bottonOverlayWindow.rootViewController = self; 
    

    // 'self' will the ViewController on which you had added UIWindow view. So whenever you ViewController change the orientation, your window view also change it's orientation.

    Let me know if you face any issue.

提交回复
热议问题