0

我刚刚开始使用 Alan Quatermain 的 AQGridView,更具体地说,是 SpringBoard 演示。

该演示显示了由 UIImageView 组成的图标/图块。我想知道如何改用自定义 UIView,以便我可以在下面有一个带有文本/按钮的图标。

我目前正在浏览代码,但没有真正找到我的图标是如何创建的。

任何想法/建议将不胜感激..

干杯。

4

2 回答 2

1

查看 AQGridViewCell,特别是 contentView 属性。这类似于自定义 UITableViewCell。

于 2011-07-13T15:29:54.277 回答
0

你检查过three20的TTLauncherView吗?

虽然它适用于 iPhone,但您也许可以将它用于 iPad。它允许在下面有一个带有文本的图标。尽管您可能不得不破解它以插入自定义 UIView 来代替图像和文本。

我发现iOSGuy 的教程在使用 TTLauncherView 时很有帮助。

这里是 iOSGuy 教程的摘录,展示了它是如何设置/使用的。

TTLauncherView* launcherView = [[TTLauncherView alloc]
          initWithFrame:self.view.bounds];
   launcherView.backgroundColor = [UIColor blackColor];
   启动器视图.columnCount = 4;
   launcherView.pages = [NSArray arrayWithObjects:
     [NSArray 数组与对象:
         [self launcherItemWithTitle:@"Google"
              图片:@"bundle://safari_logo.png"
                 网址:@"http://google.com"],
        [self launcherItemWithTitle:@"Apple"
              图片:@"bundle://safari_logo.png"
                 网址:@"myAppController/myView"]
        , 无]
    , 无];
于 2011-07-12T14:41:49.333 回答