フォーラムを調べてみましたが、これに対する答えが見つからないので、投稿します。UIPickerView または UIDatePickerView を備えた UIActionSheet を使用して、ユーザーに入力を促すアプリがいくつかあります。これらの入力は構成値用です。そのため、プロンプトは iPad のポップオーバーの上に表示されます。
このコードは、iPad と iPhone 5 でうまく機能し、iPhone 4.3 も気に入っています。ipad 4.3 が全く動かない。振る舞いは奇妙です。PickerView も表示されません (「時間」や「分」などの見出しだけが上部に表示されます)。または、左側に 10 ピクセル幅のブロックとして表示され、操作したり使用したりできません。
以下のスクリーンショットとコード。何か案は?以下のコードは、最初のスクリーンショットの外観を生成します。最初のスクリーンショットのコードは実質的に同じですが、UIPickerView が含まれています。これらはシミュレーターから取得したものですが、物理デバイスで同じ問題を報告するユーザーがいます。
前もって感謝します - ケビン
// 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:self.view];
UIDatePicker *pickerView = [[UIDatePicker alloc] init];
[pickerView setDatePickerMode: UIDatePickerModeCountDownTimer];
if (timerInterval == 0) timerInterval = 5;
[pickerView setMinuteInterval: timerInterval];
[pickerView setCountDownDuration: [timerRec.timerDuration intValue]];
[actionSheet addSubview:pickerView];