简体   繁体   中英

dynamically add Items to TTLauncher

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 :)

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM