Ipad / iphone..action表

时间:2011-02-08 07:10:40

标签: iphone objective-c ios ipad uiactionsheet

我使用了选择器视图和日期选择器以及操作表,它在iphone中运行良好。 我升级了ipad的iphone应用程序。我设置动作表autoresize属性,但它没有在ipad中显示,当我旋转iphone时。这是我的代码

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];

1 个答案:

答案 0 :(得分:0)

在iPad中使用Actionsheet时应​​注意的一点是它显示为PopOver ViewController。它是iPad中Action Sheet的默认行为。

干杯