if ([_info[@"cashBack"] floatValue] > 0) {
spa
y += 10.0;orm
// 離店返金額說明string
UILabel *cashBackLabel = [TRIPLabelFactory createLabelWithText:[[NSString stringWithFormat:@"返¥%0.2f",[_info[@"cashBack"] floatValue]/100.0] hotelPriceFormat]it
color:LABEL_REDclass
fontSize:10float
labelStyle:LabelStyleSolid];標籤
CGSize labelTextSize = [cashBackLabel.text calculateSizeWithFont:cashBackLabel.font];co
text = [[NSString stringWithFormat:@"入住離店後再返¥%0.2f信用住酒店紅包",[_info[@"cashBack"] floatValue]/100.0] hotelPriceFormat];cas
size = [text calculateSizeWithFont:TEXT_FONT constrainedToSize:CGSizeMake([UIScreen mainScreen].bounds.size.width-15.0-5.0-cashBackLabel.width, 1000)];context
if (!onlyHeight) {
// 畫標籤
[LABEL_RED set];
CGContextRef context5 = UIGraphicsGetCurrentContext(); //設置上下文
CGContextSetLineWidth(context5, 1.0);
CGContextSetRGBStrokeColor(context5, 0.8, 0.1, 0.8, 1);
CGContextFillRect(context5, CGRectMake(x, y+(size.height-cashBackLabel.height)/2.0, cashBackLabel.width, cashBackLabel.height));
// 畫標籤文案
[[UIColor whiteColor] set];
[cashBackLabel.text drawInRect:CGRectMake(x+(cashBackLabel.width-labelTextSize.width)/2.0, y+(size.height-cashBackLabel.height)/2.0, cashBackLabel.width, cashBackLabel.height) withFont:cashBackLabel.font];
[TITLE_TEXT_COLOR set];
[text drawInRect:CGRectMake(x+cashBackLabel.width+5.0, y, size.width, size.height) withFont:TEXT_FONT];
}
y += size.height;
}