UITableViewCell的根本使用

UITableViewCell的基本使用

//在cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
下设置cell文字居中

cell.textLabel.text =@"清除缓存";

cell.indentationLevel =12;

如图所示:

UITableViewCell的根本使用

//在cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];

下设置cell文字居中

cell.textLabel.text =@"意见反馈";

cell.textLabel.textAlignment =NSTextAlignmentCenter;

如图所示:

UITableViewCell的根本使用


//设置cell右侧的文字

//在cell =[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];

cell.textLabel.text = @"新版本检测";

cell.detailTextLabel.text = @"V2.6.1";

如图所示:

UITableViewCell的根本使用