我是否正确实施了 TTLauncher?

发布于 2024-09-03 01:35:51 字数 309 浏览 2 评论 0原文

我正在研究 TTCatalog 示例,只是尝试添加一个带有 appdelegate 中映射的 url 的 url:

  [[[TTLauncherItem alloc] initWithTitle:@"Button 1"
                           image:@"bundle://Icon.png"
                           URL:@"tt://photoTest1" canDelete:YES] autorelease],

出于某种原因,当您单击它时它根本不执行任何操作。

I was playing around with the TTCatalog example, just tried adding a url with a url mapped in the appdelegate:

  [[[TTLauncherItem alloc] initWithTitle:@"Button 1"
                           image:@"bundle://Icon.png"
                           URL:@"tt://photoTest1" canDelete:YES] autorelease],

For some reason, it's not doing anything at all when you click on it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

傲性难收 2024-09-10 01:35:51

如果您还无法弄清楚这一点,我的猜测是您没有在 launcherView: didselectitem: 中执行任何操作,

只需在方法内创建一个 TTNavigator 对象,然后调用 openURLAction。例如

(void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item 
{
    TTNavigator *navigator = [TTNavigator navigator];
    [navigator openURLAction:[TTURLAction actionWithURLPath:item.URL]];
}

In case you haven't been able to figure this one out yet, my guess is that you are not doing anything in launcherView: didselectitem:

Just create a TTNavigator object inside the method and then call openURLAction. For example

(void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item 
{
    TTNavigator *navigator = [TTNavigator navigator];
    [navigator openURLAction:[TTURLAction actionWithURLPath:item.URL]];
}
闻呓 2024-09-10 01:35:51

如果 Robert Lowery 的答案不起作用,请检查您的启动器视图委托。

TTLauncherView.delegate 属性应指向您的视图控制器,并应实现 TTLauncherViewDelegate 协议。 (否则 launcherView:didSelectItem: 将永远不会被调用。)

If Robert Lowery's answer doesn't work, check your launcher view delegate.

The TTLauncherView.delegate property should be pointing to your view controller and should implement the TTLauncherViewDelegate protocol. (Otherwise launcherView:didSelectItem: will never get called.)

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