I have a UILabel
and its text is generated dynamically, so depending upon text, UILabel
width increases from iOS6 to iOS8
. Is there any solution for this? it is only working on iOS7 and in iOS6.0 boundingRectWithSize
method is crashing, its say boundingRectWithSize
method only for iOS7.0 and above.
float widthIs =[[tagsArray objectAtIndex:i] boundingRectWithSize:_tagsValue.frame.size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:_tagsValue.font } context:nil].size.width;
_tagsValue.frame=CGRectMake(prevTag, 2, widthIs+20, 30);
prevTag+=widthIs+30;