Я добавляю вид выбора в список действий, который отлично работает в iPhoneНо в iPad я не вижу лист действий.Я вижу один маленький прямоугольник в середине экрана в iPad.Вот код, который я написал:
NSString *actionSheetTitle = @"Select Date of Birth";
UIActionSheet *dateSheet = [[UIActionSheet alloc] initWithTitle:actionSheetTitle
delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles:@"Done",nil];
dateSheet.delegate = self;
dateSheet.actionSheetStyle = UIActionSheetStyleAutomatic;
dateSheet.destructiveButtonIndex = 0; // make the second button red (destructive)
dateSheet.tag = 100;
//Add the picker
UIDatePicker *pickerView = [[UIDatePicker alloc] initWithFrame:CGRectMake(0,185,0,0)];
pickerView.datePickerMode = UIDatePickerModeDate;
[pickerView addTarget:self action:@selector(dateSelectionChanged:) forControlEvents:UIControlEventValueChanged];
[dateSheet addSubview:pickerView];
[dateSheet showInView:self.view];
[dateSheet setBounds:CGRectMake(0,0,320,700)];
self.tempDob = self.dob;
if (self.editPatientDetails)
{
NSDateFormatter* dtFormatter = [[NSDateFormatter alloc] init];
[dtFormatter setDateFormat:@"MM/dd/yyyy"];
NSDate* dateSelected = [dtFormatter dateFromString:self.dob];
[dtFormatter release];
[pickerView setDate:dateSelected animated:YES];
}
[pickerView release];
[dateSheet release];