Home > Mobile > IOS development lable adaptive padding after how to solve
IOS development lable adaptive padding after how to solve
Time:12-01
Lable with [lb44 text boundingRectWithSize: CGSizeMake (* KB5HEIGHT kWindowW - 20, 1000) options: NSStringDrawingUsesLineFragmentOrigin attributes: [NSDictionary dictionaryWithObjectsAndKeys: lb44. The font, NSFontAttributeName, nil] context: nil]; Methods
Under the great god told me
CodePudding user response:
Do you have a highly adapt yourself? I will not STR + (CGSize) caluteStr: (nsstrings *) Si (CGSize) Si fon (CGFloat) the font { Return [STR boundingRectWithSize: si options: NSStringDrawingUsesLineFragmentOrigin attributes: @ {NSFontAttributeName: [UIFont systemFontOfSize: the font]} the context: nil]. Size; }
CodePudding user response:
I am using this method, and then after calculating the height to make the lable fame change, but found that lable have padding up and down, and content is the more the number of rows in the lable, padding, the greater the eldest brother know what's the problem?