UIActionSheet positioning is not centered when I open it in landscape mode. If I set bounds or change the frame. The contents inside the开发者_开发问答 UIActionSheet which is a subview changes but the actual sheet remains in the same place which looks very awkward.
How do I move the UIActionSheet along with it's subview to the center of the screen?
You can use the following code so that you can put he UIActionsheet in the middle of the screen as you want.
UIActionSheet *actionsheet1 = [[UIActionSheet alloc]initWithTitle:@"Options" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Contacts", @"Employees",nil];
actionsheet1.tag = 1;
[actionsheet1 showInView:self.view];
[actionsheet1 setActionSheetStyle:UIActionSheetStyleBlackOpaque];
[actionsheet1 release];
Please check this code and let me knwo if you still have any questions.
精彩评论