Reputation: 5902
I've been trying to solve this all day, I upgraded my mainWindow.xib to the 4 inch iPhone 5 version, and all of my ActionSheets behave normal on the 4 inch simulator. However, if I cancel composing an E-Mail in portrait mode on 3.5 inch devices, the action sheet is not completely revealed (the Cancel button is hidden).
I appreciate any help offered.
Here is a screenshot of the issue in portrait:
Here is the code I'm using to display the action sheet and counter-act for the 3.5 inch screen sizes due to my mainWindow.xib being a 4 inch version now:
sheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Share via iMessage/SMS", @"Share via E-Mail", @"Review App", nil];
// This code is for the iPhone 5 portrait & landscape, 3.5" landscape, and iPad
if ([[UIScreen mainScreen] applicationFrame].size.height == 548 | orientation == UIInterfaceOrientationLandscapeLeft | orientation == UIInterfaceOrientationLandscapeRight | UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
[sheet showInView:self.parentViewController.view];
}
// This code is for 3.5" portrait
else
{
[sheet showInView:self.parentViewController.view];
[sheet setFrame:CGRectMake(0, 220, 320, 320)];
}
Upvotes: 1
Views: 598
Reputation: 5902
Found the solution; I had to change my mainWindow.xib size to None, and in my app delegate add this line:
self.window.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen mainScreen]bounds].size.height);
Upvotes: 4