iOS UITableViewCell透明度 和 cell文字居中

1、创建UITableViewCell时,的模式用UITableViewCellStyleValue1时,透明度直接将UITableView的透明度设置以下就搞定拉,但是文字居中难以实现。

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的透明度设置一下就搞定拉。


欢迎大侠们提出宝贵意见。

你可能感兴趣的:(UITableViewCell)