I want a wordwrapping for string to just wanted for the dynamic height calculations purpose, because in UILabel NSLineBreakByWordWrapping, counting string height for dynamic purpose is easy to adjust UILabel height please can any buddy let me know the wordwrapping in string ?
CGSize size = CGSizeZero;
NSString *carNameString = cars.name;
carNameString = [carNameString stringByReplacingOccurrencesOfString:@"\n" withString:@"\n\n"];
CGRect f1 = [carNameString boundingRectWithSize:CGSizeMake([[UIScreen mainScreen]bounds].size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{ NSFontAttributeName:[UIFont fontWithName:@"Copperplate" size:20] } context:nil];
size = CGSizeMake(f1.size.width, f1.size.height + 1);
Note: I am using iOS Version 6.3
Aucun commentaire:
Enregistrer un commentaire