У меня есть некоторые проблемы с UIActionsheet на iPad. Его высота не меняется, поэтому я не вижу кнопку Done
и вот мой код:
-(void) showActionSheet{
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@""
delegate:self
cancelButtonTitle:@"cancel"
destructiveButtonTitle:@"Done"
otherButtonTitles:nil];
Reports = [[NSMutableArray alloc] init];
//Add the picker
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 80, 0, 0)];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(5, 20, 400, 420)];
datePicker.datePickerMode = UIDatePickerModeDate;
[menu addSubview:datePicker];
[menu showFromRect:[self frame] inView:self animated:YES];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
[menu setBounds:CGRectMake(0,0,480, 260)];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
[menu setBounds:CGRectMake(-20,10,480, 400)];
menu.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin
|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin;
[menu release];
}