Counting the number of lines in a UITextView, lines wrapped by frame size

前端 未结 13 1469
逝去的感伤
逝去的感伤 2020-11-27 03:42

I wanted to know when a text is wrapped by the frame of the text view is there any delimiter with which we can identify whether the text is wrapped or not.

For insta

13条回答
  •  遥遥无期
    2020-11-27 03:55

    Use this (where _text_v is your text view):

    -(NSInteger) linesCount {
        return _text_v.contentSize.height/_text_v.font.lineHeight;
    }
    

提交回复
热议问题