Search code examples
objective-cioscocoa-touchaqgridview

AQGridView iOS Create custom icons (image+label) instead of image


I've just started using AQGridView from Alan Quatermain more specifically, the SpringBoard demo..

The demo shows icons/tiles that consist of a UIImageView. I'd like to know how to use a custom UIView instead so that I can have an icon with text/button underneath.

I'm currently trawling through the code with no real luck in finding how my icons are created.

Any ideas/suggestions would be greatly appreciated..

Cheers.


Solution

  • Have you checked out three20's TTLauncherView?

    Although it is for the iPhone you might be able to adopt it for the iPad. It allows for an icon with text underneath. Though you might have to hack it for inserting a custom UIView in place of the image and text.

    I found iOSGuy's tutorial helpful when working with TTLauncherView.

    And here is an excerpt from iOSGuy's tutorial to show little bit about how it is setup/used.

    TTLauncherView* launcherView = [[TTLauncherView alloc]
              initWithFrame:self.view.bounds];
       launcherView.backgroundColor = [UIColor blackColor];
       launcherView.columnCount = 4;
       launcherView.pages = [NSArray arrayWithObjects:
         [NSArray arrayWithObjects:
             [self launcherItemWithTitle:@"Google"
                  image:@"bundle://safari_logo.png"
                     URL:@"http://google.com"],
            [self launcherItemWithTitle:@"Apple"
                  image:@"bundle://safari_logo.png"
                     URL:@"myAppController/myView"]
            , nil]
        , nil];