UITableView是iOS应用中最常使用的控件之一,而通过对其中的UITableViewCell的自定以更可以实现很多不同的显示效果。
UITableViewCell包含以下四种风格:
1. UITableViewCellStyleDefault:
2. UITableViewCellStyleSubtitle:
3. UITableViewCellStyleValue1
4. UITableViewCellStyleValue2
通过设置UItableViewCell的textLable的lineBreakMode和Lines属性,可以使得textLable识别‘\n’等转义字符并显示多行文本。
[cell.textLable setLineBreakMode:NSLineBreakByWordWrapping];
[cell.textlable setNumberOfLines:0];
通过设置UITableViewCell的backgroundColor和backgroundView可以使UItableViewCell具有透明效果。
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView = [[UIView alloc] initWithFrame:CGRectZero];