1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| @interface ILSettingCell() @property (nonatomic,strong) UILabel *labelView; @end
-(UILabel *)labelView { if (_labelView==nil) { _labelView=[[UILabel alloc]init]; _labelView.bounds=CGRectMake(0, 0, 100, 25); _labelView.textColor=[UIColor redColor]; _labelView.textAlignment=NSTextAlignmentRight; } return _labelView; } //设置右边的视图 -(void)setUpAccessoryView { //...省略内容 if([_item isKindOfClass:[ILSettingLabelItem class]]) { self.accessoryView=self.labelView; self.selectionStyle=UITableViewCellSelectionStyleNone; ILSettingLabelItem *labelItem=(ILSettingLabelItem *)_item; self.labelView.text=labelItem.text; } //...省略内容 }
|