我尝试使用sizeWithAtrributes
,但它只是打破了,不确定我做错了这是出现的错误sizeWithFont:minFontSize:actualFont:forWidth:lineBreakMode:
在iOS7中已弃用:
if (theRect.size.width > self.bounds.size.width - rightIconNeeds - leftIconNeeds) {
CGFloat finalSize = realLabel.font.pointSize;
theRect.size = [realLabel.text sizeWithFont:realLabel.font
minFontSize:realLabel.font.pointSize * realLabel.minimumScaleFactor
actualFontSize:&finalSize
forWidth:self.bounds.size.width - rightIconNeeds - leftIconNeeds
lineBreakMode:realLabel.lineBreakMode];
}