我将背景颜色设置为表格视图。颜色具有30%的透明度。问题是没有单元格的那部分表格,透明度设置显示颜色。但单元格显示不透明。TableViewCell颜色问题
我没有在代码中设置颜色。表格背景颜色在故事板中设置。请要求提供任何其他信息。
表在故事板:
代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyCell *cell = (MyCell *) [self.tableView dequeueReusableCellWithIdentifier:CELL_IDENTIFIER forIndexPath:indexPath];
// Set cell content
cell.NameLabel.text = ...;
cell.SequenceLabel.text = ...;
cell.NumberLabel.text = ...;
cell.backgroundColor = tableView.backgroundColor; // Also tried setting to [UIColor clearColor]
return cell;
}
那么问题是什么?你希望细胞显示透明度? – Avt
@Avt是的,单元格应该具有相同的颜色和相同的alpha值。 – Geek
@FahimParkar代码中没有任何显示。代码只是设置标签值。没有重用标识符,它将如何工作?它的自定义单元。 – Geek