dynamically add Items to TTLauncher

▼魔方 西西 提交于 2020-01-03 03:25:12

问题


in my app i got a TTLauncher Object with some TTLauncherItems in it. Now i want to add some Items dynamically inside my App by pressing a button.

Is there a simple way to do that or do i have to create my own methods? In the original facebook application there is already something like that implemented. (You can add your Friends to the Launcher)

If not, what would be the best thing to do something like that? Store all "extra items" in a plist oder even in a database and query them, each time TTLauncher object is initialized?

Thanks for help :)


回答1:


so i finally used a simple plist to store my items. every time my items get new arranged or an item gets added, i update my plist with this new data. when the view gets initialised, i building all this items out of my plist.

a better way would be to store it in a database i think, but for me, a plist is enough.




回答2:


I have ran out in the same issue as I told you earlier: so

  1. You store your additional icons in a table.

on LoadView()

you try to use a dynamic array like this:

_launcherView.pages = [NSArray arrayWithObjects: dynamicArr1];

Where your dynamic Array is filled like this:

caching of images of each icon here:

http://groups.google.com/group/three20/msg/66ec114401af3b06

[dynamicArr1 insertObject:[[[TTLauncherItem alloc] initWithTitle:name
                                                                              image:name
                                                                                URL:url canDelete:YES] autorelease] atIndex:i];

Let me know if that's what you were looking for.



来源:https://stackoverflow.com/questions/2681361/dynamically-add-items-to-ttlauncher

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!