微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

iPhone AppStore的UITableViewCell背景色

如何解决iPhone AppStore的UITableViewCell背景色

| 我想在我的iPhone App中测试一些不同的彩色单元格,我认为与应用商店相同的彩色单元格可能会适合。因此,我想尝试一下。不幸的是,我没有电池的颜色代码,有人知道吗? 这些是起作用的颜色: 另外,此代码是否可以正确显示它们?
- (void)tableView: (UITableView *)tableView willdisplayCell: (UITableViewCell *)cell forRowAtIndexPath: (NSIndexPath *)indexPath {

if ( indexPath.row%2 == 0) { 
UIColor *altCellColor = [UIColor colorWithRed:256/256.0 green:237/256.0 blue:227/256.0 alpha:1.0]; /
cell.backgroundColor = altCellColor;
}
if ( indexPath.row%2 == 1) {
UIColor *altCellColor2 = [UIColor colorWithRed:1 green:1 blue:1alpha:1.0];
cell.backgroundColor = altCellColor2;
}
    

解决方法

您发布的代码看起来可以使用。您要寻找的两种颜色是
[UIColor colorWithRed:.678 green:.678 blue:.69 alpha:1]
[UIColor colorWithRed:.596 green:.596 blue:.612 alpha:1]
    ,如果您使用的是Mac,则只需在Spotlight中搜索
Digital Color Meter
(Application实用程序中的该应用程序)。此应用程序将为您提供所需的任何RGB和其他颜色代码值。 谢谢     ,您可以使用此代码。对我有用
[UIColor colorWithRed:172.0/255.0 green:217.0/255.0 blue:246.0/255.0 alpha:1]
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。