I have UIAlertView in UIView. Alert View will appear when error about login occur.
Sometime it worked on Center Position following this picture.

My code
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login Failed" message:exceptionString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
but sometime it worked on Left Position following this picture.

I want on Center Position only.
How to fix it. Thank you.
How are you displaying the alert view? Are you setting the frame with this style initWithFrame?
It should be something like the following.
NSString *exceptionString = "something"; // where ever you get you failed message.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login Failed" message:exceptionString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With