// // SheetViewCellTableViewCell.m // IBOSSmini // // Created by guan hong hou on 2018/3/30. // Copyright © 2018年 elongtian. All rights reserved. // #import "SheetViewCell.h" @implementation SheetViewCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; return self; } - (void)setInvoiceStyle:(InvoiceStyle *)style{ UIView *invoiceStyleView=[UIView new]; invoiceStyleView.frame=CGRectMake(0,0, Screen_Width,40); [self addSubview:invoiceStyleView]; NSDictionary *styleDict = @{NSFontAttributeName:kTextFont}; _invoiceStyle=style; _invoiceStyleLbl = [UILabel new]; _invoiceStyleLbl.textColor = [UIColor blackColor]; _invoiceStyleLbl.font = [UIFont systemFontOfSize: LabelAndTextFontOfSize]; NSString *invoiceStyle= _invoiceStyle.invoiceStyleName; if(invoiceStyle!=nil&&invoiceStyle.length>0){ CGRect invoiceStyleFrame = [invoiceStyle textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes:styleDict]; invoiceStyleFrame.origin.x =Screen_Width/2-invoiceStyleFrame.size.width/2; invoiceStyleFrame.origin.y =10; _invoiceStyleLbl.frame=invoiceStyleFrame; _invoiceStyleLbl.text=invoiceStyle; } [invoiceStyleView addSubview:_invoiceStyleLbl]; UIView *bottomSeparatorView = [UIView new]; bottomSeparatorView.frame=CGRectMake(0,40, Screen_Width, 1); bottomSeparatorView.backgroundColor = LineBackgroundColor; [invoiceStyleView addSubview:bottomSeparatorView]; } @end