I have a UITextView and want to set its height as per its content changes.
How can I get height of the content.
Please guide me.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to calculate height of your
UITextViewfor some text then you can use such method:In
fontWithNamedefine font that you are using inUITextView, in size parameter – size of your text inUITextView. ReplaceWIDHT_OF_VIEWwidth width of yourUITextView.textViewSize.heightwill contain height thatUITextFieldto display text without scrolling