Forcing UIAlertView into landscape mode

后端 未结 5 1021
花落未央
花落未央 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:34

    It should rotate automatically if you're using UIViewController. Did you forget to return YES for the desired orientations in shouldAutorotateToInterfaceOrientation?

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return YES; /* auto rotate always */
    }
    

提交回复
热议问题