//在cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
下设置cell文字居中
cell.textLabel.text =@"清除缓存";
cell.indentationLevel =12;
如图所示:
//在cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
下设置cell文字居中cell.textLabel.text =@"意见反馈";
cell.textLabel.textAlignment =NSTextAlignmentCenter;
如图所示:
//设置cell右侧的文字
//在cell =[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
cell.textLabel.text =@"新版本检测";
cell.detailTextLabel.text =@"V2.6.1";
如图所示:
设置cell的背景图片
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]];// 使用自己的图片作为cell的背景
设置cell点击时的背景
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[supersetSelected:selected animated:animated];
// Configure the view for the selected state
UIView *bgView = [[UIViewalloc]initWithFrame:self.frame];
bgView.backgroundColor = [UIColorwhiteColor];
self.selectedBackgroundView = bgView;
}
cell.selectionStyle=UITableViewCellSelectionStyleNone;