【问题标题】:AQGridView iOS Create custom icons (image+label) instead of imageAQGridView iOS 创建自定义图标(图像+标签)而不是图像
【发布时间】:2011-07-08 12:05:12
【问题描述】:

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

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

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

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

干杯。

【问题讨论】:

标签: objective-c ios cocoa-touch aqgridview


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    你查看过three20的TTLauncherView吗?

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

    我发现iOSGuy's tutorial 在使用 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"] , 无] , 无];

    【讨论】:

    • 您好,感谢您的回复,但 TTLauncherView 链接已失效 :( 您有示例代码吗?
    • 嗯,我不知道他们的官方页面为什么关闭了。现在你可以去他们的 github 页面:github.com/facebook/three20 我上面链接的教程有一些示例代码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-31
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    相关资源
    最近更新 更多