TTNavigator:如何将参数传递给自定义 UIWebView?

发布于 2024-10-20 03:26:52 字数 750 浏览 6 评论 0原文

我已经用这个 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 技术交流群。

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

发布评论

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

评论(1

古镇旧梦 2024-10-27 03:26:52

我认为您可能会发现创建一个扩展 TTWebController 的类会更容易,该类将允许您执行所需的任何自定义操作,而不是尝试将 URL 作为 TTURL 中的参数传递。然后您将映射您想要转到该页面的 Web URL 以加载自定义控制器

因此您的新类将如下所示:

@interface CustomWebController : TTWebController {
}

@end

@implementation CustomWebController
    // Customizations
}

@end

然后您将向 TTURLMap

[map from:@"www.google.it" toViewController: [CustomWebController class]];

和启动器项目添加映射

[[TTLauncherItem alloc] initWithTitle: @"Online"
                        image: @"bundle://safari_logo.png"
                        URL: @"www.google.it"];

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:

@interface CustomWebController : TTWebController {
}

@end

@implementation CustomWebController
    // Customizations
}

@end

and then you would add a mapping to your TTURLMap

[map from:@"www.google.it" toViewController: [CustomWebController class]];

and your launcher item

[[TTLauncherItem alloc] initWithTitle: @"Online"
                        image: @"bundle://safari_logo.png"
                        URL: @"www.google.it"];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文