标签栏控制器的模态视图问题
我有一个标签栏控制器,当加载标签栏控制器时,我想要做的是加载注册页面。这是我的代码。
RegistrationScreen *registrationScreen = [[RegistrationScreen alloc] initWithNibName:@"RegistrationScreen" bundle:nil];
[self.tabBarController presentModalViewController:registrationScreen animated:FALSE];
[registrationScreen release];
这很好用。但在我的注册页面中,我有另一个视图,即“自述”。一旦您单击注册页面中的链接,我需要将其加载为另一个模式视图。然而这并没有被触发。我在这里做错了什么?我应该怎么做才能在选项卡栏控制器顶部加载多个视图?
谢谢
I have a tab bar controller and when loading the tab bar controller what I want to do is to load a registration page. Here is my code for this.
RegistrationScreen *registrationScreen = [[RegistrationScreen alloc] initWithNibName:@"RegistrationScreen" bundle:nil];
[self.tabBarController presentModalViewController:registrationScreen animated:FALSE];
[registrationScreen release];
This works fine. But in my registration page i have a another view which is a read me. I need to load this as another modal view once you click a link in the registration page. However this not triggered. What am I doing wrong here? What should I do to load multiple views on top of tab bar controller?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于
RegistrationScreen
是一个模态视图控制器,因此它不应该具有self.tabBarController
或self.navigationController
。您可以使用 NSLog 或类似工具自行检查。它应该有
self.parentViewController
。在 RegistrationScreen.m 内尝试:
或
取决于您的流程如何工作。
Since
RegistrationScreen
is a modal view controller, it shouldn't haveself.tabBarController
orself.navigationController
. You can check yourself with NSLog or similar.It should have
self.parentViewController
.inside RegistrationScreen.m try:
or
depending on how your flow works.
TabBarController 在 AppDelegate 文件中声明。但我不知道如何使用它在选项卡栏视图控制器之一中呈现模式视图?
[self.parentViewController.tabBarController PresentModalViewController:xxxx]
我的源代码链接在这里
TabBarController is declared in AppDelegate file. But I don't know how to use this to present modal view in one of the tab bar viewControllers?
[self.parentViewController.tabBarController presentModalViewController:xxxx]
My source code link is here