Three20 - 在 vi​​ewDidLoad 之后将项目添加到 launcherView

发布于 2024-08-31 07:45:18 字数 273 浏览 2 评论 0原文

我在应用程序运行时获取图像 URL 和相应名称的列表。我想将这些图像添加到我拥有的 TTLauncherView 对象中。

无法在 loadView 中添加这些。我正在调用在单独的线程中获取数据的方法。线程完成后,我将 TTLauncherItem 对象添加到数组中,并设置 LauncherView 的“pages”变量。

但由于某种原因,视图没有更新,我没有看到任何内容。

有人可以让我知道如何在使用 loadView 以外的方法添加项目后刷新启动视图吗?

谢谢。

I am getting a list of image URLs and corresponding names at run time in my app. I would like to add these images to a TTLauncherView object that I have.

Cannot add these in loadView. I am making a call to the method for getting my data in a separate thread. Once the thread completes, I add the TTLauncherItem objects to an array and set the "pages" variable of the LauncherView.

But for some reason, the view is not updated and I don't see anything on it.

Can someone please let me know how to refresh the launcherview after adding items to it in methods other than loadView?

Thanks.

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

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

发布评论

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

评论(1

迷雾森÷林ヴ 2024-09-07 07:45:18

我使用以下代码片段在加载后将项目添加到 launcherView 中。

TTLauncherItem *item = [[TTLauncherItem alloc] initWithTitle:@"NEW ITEM NAME"
                                                       image:@"NEW_ITEM_IMAGE_URL"
                                                         URL:@"NEW_ITEM_ACTION_URL"
                                                   canDelete:YES];
[_launcherView endEditing];
//add the item after ending editing to show the close x.
[_launcherView addItem:item animated:YES];

I use the following snippet to add an item to the launcherView after load.

TTLauncherItem *item = [[TTLauncherItem alloc] initWithTitle:@"NEW ITEM NAME"
                                                       image:@"NEW_ITEM_IMAGE_URL"
                                                         URL:@"NEW_ITEM_ACTION_URL"
                                                   canDelete:YES];
[_launcherView endEditing];
//add the item after ending editing to show the close x.
[_launcherView addItem:item animated:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文