【发布时间】:2012-04-08 17:15:32
【问题描述】:
我在这个表格视图中每个单元格的左上角绘制了一个奇怪的半圆。我似乎无法摆脱它。我没有在我的单元格中进行任何自定义绘图,尽管这些单元格都是 UITableViewCell 的子类。
弯曲的工件仅出现在每个部分的第一个单元格中,并且无论表格视图背景如何,它仍然是持久的。
这是单元格中的所有自定义代码,其余在IB中
- (void)layoutSubviews {
// NSLog(@"DataEntryCell layoutSubviews");
UILabel *topLabel = [self parameterLabel];
UILabel *bottomLabel = [self dataLabel];
topLabel.font = [UIFont boldSystemFontOfSize:18.0];
topLabel.textAlignment = UITextAlignmentCenter;
topLabel.textColor = [UIColor darkGrayColor];
topLabel.shadowColor = [UIColor lightGrayColor];
topLabel.shadowOffset = CGSizeMake(0.0, 1.0);
bottomLabel.font = [UIFont systemFontOfSize:16.0];
bottomLabel.textAlignment = UITextAlignmentLeft;
bottomLabel.textColor = [UIColor darkGrayColor];
bottomLabel.numberOfLines = 0;
bottomLabel.lineBreakMode = UILineBreakModeWordWrap;
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
self.selectionStyle = UITableViewCellSelectionStyleGray;
self.autoresizesSubviews = YES;
}
知道是什么原因造成的吗?
谢谢
【问题讨论】:
-
你需要分享一些代码或更多关于你到目前为止所做的事情的信息
-
您的表格有“分组”样式吗?如果是这样 - 如果您将其设置为“普通”,您仍然有同样的问题吗?在分组样式表视图中,单元格的内容视图从侧面缩小(或覆盖)。这可能是问题所在。我也认为如果你有一个三行的表,只有顶部和底部的会有这种异常。
-
是的,它使用分组样式。只有顶层单元格有这个。但它是什么,我怎样才能摆脱它?
-
这可能是绘图故障。你用标准条纹背景得到它吗?
-
刚刚检查过,是的,我仍然使用默认背景。
标签: objective-c xcode ios5 uitableview