如何从 UITableView 打开模态视图(表单)?
我厌倦了尝试从 iPad 应用程序打开模态视图控制器。 如何显示像表单这样的模态视图?
这是我的代码块。 就像这种打开窗口(全屏)的样式,但我的模态视图中没有任何对象
viewDetail *hd = [[viewDetail alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
,只是我想在从 UITableView 选择值时打开 formSheet 模态视图 顺便说一下,我正在 xcode 4.2.1 上进行开发并使用 Storyboard 功能 谢谢你的帮助。
这样会出现 SIGABRT 错误
viewDetail *hd = [[viewDetail alloc] initWithNibName:@"viewDetail" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
I am tired try open a modal view controller from ipad application.
How I can show a modal view like formsheet?
here my code block.
like this style opening a window (full screen) but there is don't have any object from my modal view
viewDetail *hd = [[viewDetail alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
just i want open a formSheet modal view when selected a value from UITableView
by the way, i am development on xcode 4.2.1 and usind storyboard features
thanks for help.
like that give a SIGABRT error
viewDetail *hd = [[viewDetail alloc] initWithNibName:@"viewDetail" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我修复了我的解决方案,从故事板中创建了一个 xib 文件。
但为什么它在故事板中不起作用?有办法吗?
I fixed my solution, worked a xib file out of story board.
But why wasn't it working in storyboard? There is a way for that?
如果您使用故事板,则必须将
[self.storyboard instantiateViewControllerWithIdentifier:@"viewDetail"];
设置为viewDetail
视图控制器。 (假设您相应地设置了故事板标识符)希望有所帮助。
If you're using storyboards, you have to set
[self.storyboard instantiateViewControllerWithIdentifier:@"viewDetail"];
as yourviewDetail
View Controller. (Assuming you set the Storyboard Identifier accordingly)hope that helps.