1.设置UITableViewCell的背景色透明:
设置UIColor为clearColor:
cell.backgroundColor=[UIColor clearColor];
或者,设置颜色透明度为0:
cell.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.0f];
2.设置UITableViewCell的选中背景颜色的方法:
UIView *view = [[UIView alloc]init];
view.backgroundColor=[UIColor redColor];
cell.selectedBackgroundView=view;
附,设置UITableViewCell的选中字体颜色的方法:
cell.selectedTextColor=[UIColor blackColor];//默认显示为白色
(但是这段代码会产生一个警告,'selectedTextColor' is deprecated : first deprecated in iOS 3.0,
苹果表示已不建议使用。)