AQGridView iOS 创建自定义图标(图像+标签)而不是图像

发布于 2024-11-18 20:48:44 字数 217 浏览 7 评论 0原文

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

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

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

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

干杯。

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.

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

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

发布评论

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

评论(2

赢得她心 2024-11-25 20:48:44

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

Check out AQGridViewCell and, specifically, contentView property. This is similar to customizing UITableViewCell.

秋日私语 2024-11-25 20:48:44

你检查过 Three20 的TTLauncherView

虽然它适用于 iPhone,但您也许可以将其应用于 iPad。它允许图标下方带有文本。尽管您可能需要破解它才能插入自定义 UIView 来代替图像和文本。

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

这是 iOSGuy 教程的摘录,展示了它的设置/使用方式。

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];

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];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文