【发布时间】:2010-04-15 07:28:33
【问题描述】:
我遇到了一个问题,我不知道如何解决。任何人都可以跳出框框思考并指出正确的方向吗?我会非常感激的!
问题。
我有一个包含第一行的 UITableView 总是相同的(具有重复背景的空行)下一行是动态数据行的集合。我在 IBuilder 中的 UITableView 上设置了黄色背景,我的单元格(第一行除外)有白色背景和代码:
UIView* backgroundView = [ [ [ UIView alloc ] initWithFrame:CGRectZero ] autorelease ];
backgroundView.backgroundColor = [UIColor colorWithRed: 0.96078431372549 green: 0.96078431372549 blue: 0.96078431372549 alpha: 1.0];
cell.backgroundView = backgroundView;
for ( UIView* view in cell.contentView.subviews )
{
view.backgroundColor = [ UIColor clearColor ];
}
alt text http://rabbitrun.karatefors.org/img1.png
示例黄色背景,我只想显示在顶部。正如您在下面看到的 img 示例。 问题是我不想在最后一个数据行下有黄色背景,我想在单元格上包含相同的白色。
alt text http://rabbitrun.karatefors.org/img2.png
这应该是白色的单元格。不是黄色的。
alt text http://rabbitrun.karatefors.org/img3.png
感谢您的宝贵时间。 问候
【问题讨论】:
标签: iphone cocoa-touch uitableview uikit