UITableViewCell contentView子视图显示偏移量

时间:2014-05-28 16:21:21

标签: ios objective-c uitableview uiview

我在UIView UITableViewCell contentViewwidth = 6pxheight = cell.frame.size.height)的开头添加了小cellForRowAtIndexPath - 这是在故事板中添加的。

tag = 9我通过 UIView *colorView = (UIView *)[cell viewWithTag:9]; UIColor *color = nil; if (indexPath.section == 1) { // Category section - add colors here // Get color view color = [UIColor colorForCategory:[NewsCategory categoryForString:cellTitle]]; } else { color = nil; } [colorView setBackgroundColor:color]; 到达该视图并设置其背景颜色(动态)。

indexpath.row

这样可行但是tableView更大(我们在{{1}}下去),彩色视图越来越向下偏移(y),其中最后一个单元格与上面单元格的几个像素重叠颜色视图。 Dunno为什么会发生这种情况,直到你按下细胞和新的彩色视图才会显而易见......

0 个答案:

没有答案
相关问题