iphone - UIAlertView changes to landscape when App is locked in portrait only in iOS8 -


I have an app and its orientation is locked in portrait mode, but when I have the UIAlertView and Change the iPhone to landscape, changes warning orientation and crop warnings overlay. Only in IOS8

Anyone had this error?

Yes, I got this issue. I have developed my code in iOS 7 but it was also compatible with iOS 8. So I came across I find my solution as follows:

When you are working with iOS 7, UILartview works fine, but if you are working with iOS 88 So you have to use the UASLort Controller. Use this type of code:

  if (SYSTEM_VERSION_LESS_THAN (@ "8.0")) {alert = [[UIAlertView alloc] initWithTitle: @ "Warning" message: @ "Invalid coupon." Representative: self cancel buttonTitle: @ "OK" other button titles: zero]; [Alerts show]; } Else {{UIAlertController * alertController = [UIAlertController AlertControllerWithTitle: @ "Warning" message: @ "Invalid coupon." preferredStyle: UIAlertControllerStyleAlert]; UIAlertAction * OKAction = [UIAlertAction actionWithTitle: NSLocalizedString (@ "OK", @ "Ok Action") Style: UIAlertActionStyleDefault Handler: ^ (UIAlertAction * Action) {}]; [Add alert controller action: ok work]; [Self presentViewController: alertController animated: yes completion: zero]; }   

Hope this will help you.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -