我在iPad上的UIActionsheet遇到了一些麻烦
他的身高不会随着变化而移动,所以我看不到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];
}
答案 0 :(得分:0)
要查看Done
按钮,您可以像往常一样做一件事
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@""
delegate:self
cancelButtonTitle:@"cancel"
destructiveButtonTitle:@""
otherButtonTitles:@"",@"",@"Done",nil,nil];
我认为这会奏效。
我知道这不是一个好方法,但你现在可以这样做。