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 UITextView UITextView an irregular shape).

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.

  - 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; }   

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.

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -