// // KSchoolCell.m // jiaPei // // Created by apple on 16/4/28. // Copyright © 2016年 JCZ. All rights reserved. // #import "KSchoolCell.h" @implementation KSchoolCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { CGFloat width = (kSize.width - 16)/7.0; CGFloat x,y,w,h,bd; x = bd = 8; y = 0; w = 2*width; h = 43.5; UILabel *label = [[UILabel alloc] setxywh]; label.textAlignment = NSTextAlignmentCenter; label.textColor = kTitleColor; [label setFont:[UIFont scaleSize:NormalFont]]; [self.contentView addSubview:label]; _nameLabel = label; x += 2.5*width; w = width; label = [[UILabel alloc] setxywh]; label.textAlignment = NSTextAlignmentCenter; label.textColor = kTitleColor; [label setFont:[UIFont scaleSize:NormalFont]]; [self.contentView addSubview:label]; _carTypeLabel = label; x += 2*width; label = [[UILabel alloc] setxywh]; label.textAlignment = NSTextAlignmentRight; label.textColor = [UIColor redColor]; [label setFont:[UIFont scaleSize:NormalFont]]; [self.contentView addSubview:label]; _priceLabel = label; w += 10; x += width; label = [[UILabel alloc] setxywh]; label.textAlignment = NSTextAlignmentLeft; label.textColor = kTitleColor; [label setFont:[UIFont scaleSize:NormalFont]]; [self.contentView addSubview:label]; _unitLabel = label; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end