开发者

Ipad/iphone..action sheet

开发者 https://www.devze.com 2023-02-09 08:35 出处:网络
I used picker view and date picker with action sheet and it is working fine in iphone. I upgraded my iphone app for ipad. i set action sheets autoresize property but it is not displaying in ipad and w

I used picker view and date picker with action sheet and it is working fine in iphone. I upgraded my iphone app for ipad. i set action sheets autoresize property but it is not displaying in ipad and when i rotate iphone.Here is my code

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Payment Type"
                                                      delegate:self
                                             cancelButtonTitle:@"Done"
                                        destructiveButtonTitle:@"Cancel"
                                             otherButtonTitles:nil];


// Add the picker
picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];

picker.delegate = self;
picker.showsSelectionIndicator = YES;    // note this is default to NO
picker.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[actionSheet addSubview:picker];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0,0,320, 700)];
actionSheet.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin
|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin;
[picker 开发者_开发百科release];
[actionSheet release];


One point you should keep in mind using Actionsheet in iPad is that it is displayed as PopOver ViewController.It is the default behavior of Action Sheet in iPad.

Cheers

0

精彩评论

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