将视图添加到操作表中

发布于 2024-10-25 17:03:50 字数 62 浏览 0 评论 0原文

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

谢谢

Can I add my custom UIViewController into the ActionSheet ?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

盛夏已如深秋| 2024-11-01 17:03:50

终于我找到了它...我在 UIActionSheet 中添加了一个 UIViewController 子类的视图。我在单独的文件中创建了一个视图(使用 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];

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];
离笑几人歌 2024-11-01 17:03:50

我最近创建了一个应用程序,在其中创建了操作表并在其中添加了选择器视图。
首先,您需要在 .h 文件中为操作表创建对象及其属性,如下所示:

UIActionSheet *menuProperty;    

@property(nonatomic,retain) UIActionSheet *menuArea;  

然后您需要在 .m 文件中进行以下更改

menuArea = [[UIActionSheet alloc] initWithTitle:nil  delegate:self
                                            cancelButtonTitle:@"Done"  
                                        destructiveButtonTitle:nil
                                             otherButtonTitles:nil];  


// Add the picker  
pickerArea = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];  

pickerArea.delegate = self;  
pickerArea.showsSelectionIndicator = YES;    // note this is default to NO  

[menuArea addSubview:pickerArea];  
[menuArea showInView:self.view];  
[menuArea setBounds:CGRectMake(0,0,320, 600)];  

I recently created an application where I created action sheet and added a picker view in it.
Firstly you need to create object for action sheet in your .h file as along with its properties as follows :

UIActionSheet *menuProperty;    

@property(nonatomic,retain) UIActionSheet *menuArea;  

Then you need to make following changes in your .m file

menuArea = [[UIActionSheet alloc] initWithTitle:nil  delegate:self
                                            cancelButtonTitle:@"Done"  
                                        destructiveButtonTitle:nil
                                             otherButtonTitles:nil];  


// Add the picker  
pickerArea = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];  

pickerArea.delegate = self;  
pickerArea.showsSelectionIndicator = YES;    // note this is default to NO  

[menuArea addSubview:pickerArea];  
[menuArea showInView:self.view];  
[menuArea setBounds:CGRectMake(0,0,320, 600)];  
吹泡泡o 2024-11-01 17:03:50

我认为这些链接会对你有所帮助。我从未在 uiactionsheet 中添加视图,但经过一番搜索后我认为我们可以添加。

http://www.ifans.com/forums/showthread.php?t= 301851

如何在表格视图的单元格中添加操作表< /a>

i think these links will help u. i have never add a view in uiactionsheet but after a little search i think we can add.

http://www.ifans.com/forums/showthread.php?t=301851

how add the action sheet in the cell of table view

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文