将视图添加到操作表中

问题描述:

我可以将自定义UIViewController添加到ActionSheet中吗?

Can I add my custom UIViewController into the ActionSheet ?

谢谢

最后我发现它...我已经在UIActionSheet中添加了一个UIViewController的子类视图。我在单独的文件中创建了一个视图(使用xib)。

finally I've find it... I've added a view which is subclass of UIViewController into the UIActionSheet. I've created a view in separate file (using xib) .

UIActionSheet *asheet = [[UIActionSheet alloc] init];
[asheet showInView:self.view]; 
[asheet setFrame:CGRectMake(0, 230, 320, 230)];


CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil];
innerView.view.frame = CGRectMake(0, 10, 320, 210);
[asheet addSubview:innerView.view];
//[asheet addSubview:innerView];

[innerView release];
[asheet release];