So I've upgraded the code to the ipad (i.e. converted to a universal app). However, the UIAlertview rendering seems to be off for IOS4. Instead of being positioned in the middle, it jumps up and is displayed on top, with half the box cut off. Same goes for landscape orientation.
It is my understanding that the UIalertview is always set in the middle? I looked through the code and I did not set up the frame/position anywhere in the code. This only happens for 4.0, on both the iphone 4 and the itouch running 4.0. Every other version is fine, including the ipad. Any thoughts?
Thanks.
Seems to be a bug. I also had the Problem on iPad with iOS 3.2.
Solution:
a) Check your app state: In iOS 4 just use
[UIApplication sharedApplication].applicationState
Older iOS: Store your app state manually:
-(void)applicationWillResignActive:(UIApplication *)application
{
self.appIsInBackground = YES;
}
-(void)applicationWillTerminate:(UIApplication *)application
{
self.appIsInBackground = YES;
}
-(void)applicationDidBecomeActive:(UIApplication *)application
{
// Open your UIAlert here if self.appIsInBackground == YES;
self.appIsInBackground = NO;
}
b) open the UIAlert after the app did become active, as shown above in the comments.
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