我有一个带有日期选择器的 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];
}
我得到的是从底部出现的新视图的顶部部分,仅此而已。如果我注释中间两行代码并取消注释顶部以显示常规操作表,它工作正常。有什么想法我可能做错了吗?