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
Post a Comment