UIAlertView in iOS8 appears off-center, misplaced, only part of the screen fades

I am creating an iPad app on iOS8, landscape, update from iOS7. I replaced UIAlertView (deprecated) with UIAlertController in a number of other places in my application that fixed this issue. However, I am also using UIWebView, which seems to show its own UIAlertViews. When this happens I also get the same problem (see Partial Picture Cropped). The warning goes down to the left and only the left 2/3 of the screen is dimmed, and worse, the right-most part that does not fog up still responds to touch gestures, so the app can be controlled behind the modal!

The UIWebView throwing warning is a standard "wants to use your location" warning. How do I fix this for UIWebView? Thank!

enter image description here

EDIT: The problem usually occurs when the app becomes active after trying to show an alert in the background

+3


source to share


1 answer


I met a similar problem with iPhone, this happens when the app supports multiple rotation mask and is forced to strictly one. Basically, the viewController, for example, should have the value AutoRotate = NO, this only affects the view controller and not the current window, which is the alertView represented by the UIWebView.

Try this application:supportedInterfaceOrientationsForWindow

Here's an example:



-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return (enablesRotation == YES) ? UIInterfaceOrientationMaskAllButUpsideDown : UIInterfaceOrientationMaskLandscape;
}

      

This indicates that the current window must match the required supported orientation mask. Hope this helps.

+1


source







All Articles