【发布时间】:2011-04-05 19:05:48
【问题描述】:
我使用带有操作表的选择器视图和日期选择器,它在 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];
【问题讨论】:
标签: iphone objective-c ios ipad uiactionsheet