0

我正在使用以下代码将带有选择器视图的操作表添加到我的应用程序中。在 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];
4

0 回答 0