Keyboard appears in wrong orientation in ios

前端 未结 4 1410
耶瑟儿~
耶瑟儿~ 2021-01-21 22:32

I have one viewcontroller in application that supports landscape and portrait orientations.

On a button click, a popup appears where I should enter the nam

4条回答
  •  自闭症患者
    2021-01-21 23:04

    I got exactly the same wrong keyboard orientation in some of my view controllers recently after I dropped support for iOS 8 and bumped up the deployment target to iOS 9. It turns out that one of my former colleagues used a solution here to solve an old problem when the base SDK was iOS 9 (we're now in 10, and 11 when coding from Xcode 9 beta). That solution (basically override UIAlertController's supportedInterfaceOrientations to only allow portrait) would force present the keyboard in portrait with newer SDK + deployment target even though the app window and the alert itself are in landscape.

    Removing that override solved the problem and I don't see any issue with alert over alert.

提交回复
热议问题