How to constrain orientation of alertview on device orientation change in ios8
In iOS 8, in my app, when I change the device orientation, at this time the UIAlertview will also change to the appropriate orientation. I want to limit it. I want the alertview to capture in Portrait mode.
+3
poojathorat
source
to share
2 answers
In iOS8, the system provides a new class UIAlertController replay UIAlertView and UIActionSheet, this is FYAlertView which supports iOS8 and iOS8 before using UIALertView and UIActionSheet https://github.com/wangyangcc/FYAlertManage
+3
yangyang wang
source
to share
You can use this code which might help you.
- (void)didPresentAlertView:(UIAlertView *)alertView
{
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.1];
alertView.transform = CGAffineTransformRotate(alertView.transform, degreesToRadian(90));
[UIView commitAnimations];
}
0
Jay mehta
source
to share