1

我有一个应用程序,我通过 UIActionSheet 更新表格行。在工作表上,我展示了一个 UIPickerView。UIPickerView 在 iphone 上可以正常工作并且在纵向上看起来很棒。但是当我在横向模式下打开它时,它仍然有效,但轮廓区域显示为黑色,未选中的数字也是黑色的。

下面是截图和代码。有什么明显的错误吗?

在此处输入图像描述

// create enough space for the UIPicker to show up above the selection button
NSString *title = @"\n\n\n\n\n\n\n\n\n\n\n\n";

if ((UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) &&
    (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)) {
    title = @"\n\n\n\n\n\n\n\n\n";
}


UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Choose", @"Click to finilize Value - Timer"), nil];
[actionSheet showInView:viewController.view];

UIDatePicker *pickerView = [[UIDatePicker alloc] init];
[pickerView setDatePickerMode: UIDatePickerModeCountDownTimer];
if (timerInterval == 0) timerInterval = 5;
[pickerView setMinuteInterval: timerInterval];
[pickerView setCountDownDuration: [timerRec.timerDuration intValue]];

pickerView.tag = 101;

if ((UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) &&
    (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)) {
    pickerView.frame = CGRectMake(0,0, 50,50);
}

//pickerView.delegate = self;
//pickerView.dataSource = self;
//ickerView.showsSelectionIndicator = YES;

[actionSheet addSubview:pickerView];
4

0 回答 0