ios - UITextView - anyway to figure out if entire string is visible? -
After
I am thinking, to find out if the whole string is appearing within a I do not know enough about what TextView means about having an irregular shape, though I have a Method written that returns a BOOL result to tell you whether or not the string is visible. . If you are using the font within the set font that you are using within it, it works out based on them. I'm not aware of any solution that will return the answer you are seeing without measuring the string (which certainly does this method). I hope it helps, cheers, gym. UITextView
UITextView an irregular shape).
- isStringFullyVisibleWithinTextViewWithString: (NSString *) yourString {CGSize textViewSizeOversize = CGSizeMake (TextView .frame.size.width, textView.frame.size.height + 100); NSDictionary * string properties [= NSDictionary object with the object: [UIFont systemFontOfSize: 13] forKey: NSFontAttributeName]; CGSize stringAreaSize = [your string bounding linewith the size: text view view options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin Features: String Properties Reference: Zero]. Shape; CGFloat stringEreahHeight = StringAraisease height; If (string eighth & lt; textView.frame.size.height) {return yes; } no return; }
Comments
Post a Comment