1、创建UITableViewCell时,用UITableViewCellStyleValue1时,透明度直接可以设置,但是文字居中难以实现。
2、创建UITableViewCell时,用UITableViewCellStyleDefault时,文字居中直接用cell.textAlignment = UITextAlignmentCenter;
但是只设置UITableView的透明度,背景透明难以实现
透明度具体实现代码:
cell.opaque = NO;
cell.textLabel.backgroundColor = [UIColor clearColor];
[cell setBackgroundColor:[UIColor colorWithRed:1 green:1 blue:1 alpha:0.2]];
并且将UITableView的透明度设置一下。