我正在使用以下代码将带有选择器视图的操作表添加到我的应用程序中。从iPhone上看,它显示效果很好,但在iPad(通用应用程序)上查看时,它会显示一个非常小的选择器视图,页面中央没有其他任何按钮。
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"Select Chapter"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Select"
otherButtonTitles:nil];
// Add the picker
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];
pickerView.delegate = self;
pickerView.showsSelectionIndicator = YES; // note this is default to NO
[menu addSubview:pickerView];
[menu showFromTabBar:self.tabBarController.tabBar];
[menu setBounds:CGRectMake(0,0,320, 700)];
[pickerView release];
[menu release];