Vote count:
0
I need to count number of lines in my UITextField
.
My UITextField
has an array of UIBezierPath
, to draw text along an UIImage
.
UIBezierPath *rect = [UIBezierPath bezierPathWithRoundedRect:_image.frame cornerRadius:0];
[_txt addSubview:_image];
_txt.textContainer.exclusionPaths = @[rect];
Obviously, number of lines is different because there is an exclusion path and this common way,
CGSize size = [_txt.text
sizeWithFont:_txt.font constrainedToSize:(CGSize){_txt.frame.size.width, INTMAX_MAX}
lineBreakMode:NSLineBreakByWordWrapping];
returns a wrong result.
Note: _txt
is an UITextField
.
thanks.
Test case:
Ref: http://goo.gl/Ch9al6
asked 1 min ago
How to count number of lines in UITextField?
Aucun commentaire:
Enregistrer un commentaire