Forcing UIAlertView into landscape mode

后端 未结 5 1023
花落未央
花落未央 2021-01-07 14:49

I need to display a UIAlertView in landscape mode. I tried the obvious, setting the transform in the willPresentAlertView: delegate method to no avail:

5条回答
  •  孤街浪徒
    2021-01-07 15:35

    What is the orientation of the view that shows the alert? I had the same problem, I tried to show an UIAlertView inside a landscape view but always appeared in portrait orientation. So, I forced the orientation of the status bar:

    [[UIApplication sharedApplication] setStatusBarOrientation:theOrientation];
    

    That worked to me.

提交回复
热议问题