UITextView lineBreakMode for new line

The textView is set with long text as below:


"Testing data\n\nWhat is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the printing and typesetting industry."


The textView's textContainer is set with 3 maximumNumberOfLines along with byTruncatingTail lineBreakMode. The textView is not scrollable.


Is there any way it should display ellipsis glyph at the end of 3rd line when displayed?

Replies

I have a label, with a very long text (too long for 2 lines).

I have set constraints for height and width


In simulator (for iPhone 6 or for 8 Plus), I get the ellipsis at the end.


I use XCode 9.2


I have set in IB Attributes inspector:

In the Label area

Font : system 17

alignment none (---)

uncheck Automatically adjust font

Lines : 2

Align baseline

truncate tail

fixed font size


In the view area:

Content mode: left

Semantic : unspecified

The text in UITextView ends in such manner that it doesn't have the (...) at the end. So user doesn't realise there is more content (apparently tapping on uitextview we are opening the detail page... )

Yes, I understand that. It's achievable via UILabel. But I have UITextView and I want to achieve the same behaviour. Any idea?