0
我嘗試使用sizeWithAtrributes
,但它只是打破了,不知道我做錯了這是拿出sizeWithFont:minFontSize:actualFont:forWidth:lineBreakMode:
被棄用iOS7錯誤:sizeWithFont棄用ERROR,如何解決?
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];
}
使用新的方法,http://stackoverflow.com/questions/18897896/replacement-for-deprecated-sizewithfont-in-ios-7 – ToothlessRebel