开发者

UIActionSheet position on landscape and portrait

开发者 https://www.devze.com 2022-12-23 08:25 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消