【发布时间】:2011-10-04 02:16:41
【问题描述】:
我想在 UIActionSheet 中添加一个 UIDatePicker,代码如下:
UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:@"DEMO" delegate:self cancelButtonTitle:@"Cancle" destructiveButtonTitle:nil otherButtonTitles:nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"Ratings"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:nil];
UIDatePicker *pickerView = [[UIDatePicker alloc] init];
pickerView.datePickerMode = UIDatePickerModeDate;
[actionSheet addSubview:pickerView];
[actionSheet showInView:self.view];
[actionSheet sendSubviewToBack:pickerView];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0,0,320, 500)];
CGRect pickerRect = pickerView.bounds;
pickerRect.origin.y = -100;
pickerView.bounds = pickerRect;
[pickerView release];
[actionSheet release];
问题是为什么这段代码不能在 iPad 模式下运行,而在 iphone 模式下可以运行
【问题讨论】:
-
你得到答案了吗?
标签: ios uipickerview uidatepicker uiactionsheet