TTNavigator:如何将参数传递给自定义 UIWebView?
我已经用这个 url 映射实现了 TTNavigator:
TTNavigator* navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeNone;
TTURLMap* map = navigator.URLMap;
[map from:@"tt://launcher/" toViewController: [LauncherViewController class]];
[map from:@"tt://onlineCall/(callOnlineURL:)" toViewController: [CustomWebController class]];
好吧,当 Launcher 的项目调用时:
item =
[[TTLauncherItem alloc] initWithTitle: @"Online"
image: @"bundle://safari_logo.png"
URL: @"tt://onlineCall/www.google.it"];
[launcherView addItem:item animated:YES];
我的 CustomWebController 没有显示..我如何在内部调用“loadView”???
谢谢你的帮助
I have implemented a TTNavigator with this url map:
TTNavigator* navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeNone;
TTURLMap* map = navigator.URLMap;
[map from:@"tt://launcher/" toViewController: [LauncherViewController class]];
[map from:@"tt://onlineCall/(callOnlineURL:)" toViewController: [CustomWebController class]];
Well, when a call by Launcher's item:
item =
[[TTLauncherItem alloc] initWithTitle: @"Online"
image: @"bundle://safari_logo.png"
URL: @"tt://onlineCall/www.google.it"];
[launcherView addItem:item animated:YES];
my CustomWebController doesn't show.. how i can call "loadView" internally ???
thanks for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可能会发现创建一个扩展 TTWebController 的类会更容易,该类将允许您执行所需的任何自定义操作,而不是尝试将 URL 作为 TTURL 中的参数传递。然后您将映射您想要转到该页面的 Web URL 以加载自定义控制器
因此您的新类将如下所示:
然后您将向 TTURLMap
和启动器项目添加映射
Instead of trying to pass in the URL as a param in the TTURL, I think you might find it easier to create a class that extends TTWebController that would allow you to do whatever customizations you need to do. Then you would map the web URLs you want to go to that page to load up your custom controller
So your new class would like this:
and then you would add a mapping to your TTURLMap
and your launcher item