I'm showing a UIActionSheet
like this:
-(void)accessoryPressed:(id)sender{
//Omitted unnecessary objects
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:titleString delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:@"Upload", nil];
//actionSheet.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
actionSheet.tag = ((UIButton*)sender).tag;
[actionSheet showFromRect:[(UIButton*)sender frame] inView:[(UIButton*)sender superview] animated:YES];
}
Where the sender
object is a UIButton
embedded in a UITableViewCell
's accessory view.
The problem is when the iPad is rotated the actionsheet is not resizing (I don't expect it to actually RESIZE but I want it to be in the correct X,Y) I tried setting the AutoResizingMask to FlexibleLeft and FlexibleTop but it doesn't seem to change.
Does anyone have any idea on how to get the actionSheet to point to the accessoryView
after auto-rotation?
Here is what it looks like:
Before Rotation-
After Rotation -
It's a shame UIKit
doesn't properly handle this for us. In my own app I handle this by implementing the didRotateFromInterfaceOrientation:
method in my view controller and reshow any popover again using the updated frame of the view.
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