如何从 UITableView 打开模态视图(表单)?

发布于 2025-01-02 19:43:10 字数 914 浏览 0 评论 0原文

我厌倦了尝试从 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 技术交流群。

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

发布评论

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

评论(2

海未深 2025-01-09 19:43:10

我修复了我的解决方案,从故事板中创建了一个 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?

百合的盛世恋 2025-01-09 19:43:10

如果您使用故事板,则必须将 [self.storyboard instantiateViewControllerWithIdentifier:@"viewDetail"]; 设置为 viewDetail 视图控制器。 (假设您相应地设置了故事板标识符)

希望有所帮助。

If you're using storyboards, you have to set [self.storyboard instantiateViewControllerWithIdentifier:@"viewDetail"]; as your viewDetail View Controller. (Assuming you set the Storyboard Identifier accordingly)

hope that helps.

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