【发布时间】:2010-04-11 04:31:05
【问题描述】:
我有一个带有日期选择器的 UIView,我想在操作表中显示它。我正在使用以下代码:
-(IBAction) button_click:(id)sender{
//UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"the title" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive" otherButtonTitles:@"other", nil];
UIActionSheet *sheet = [[UIActionSheet alloc] init];
ActionSheetController *actionSheet = [[ActionSheetController alloc] initWithNibName:@"ActionSheetView" bundle:nil];
[sheet addSubview:actionSheet.view];
[sheet showInView:self.view];
}
我得到的是新视图的顶部部分从底部升起,仅此而已。如果我注释中间两行代码并取消注释顶部以显示常规操作表,它工作正常。有什么想法我可能做错了吗?
【问题讨论】:
-
ActionSheetController 类是你自己的吗?可以分享一下代码吗?
标签: iphone cocoa-touch uiactionsheet