1

I have a book app. User choose a book and UITextView show it. Every book has a caption. I need to add 55px offset to the top of UITextView. I want that every caption has 55px offset. But I don't know how to do this?

1)My text height is 22px. I can add 2 or 3 empty line of text, but it doesn't suit me because I need 55px. 2)I can add contentOffset.y = 55. But I have a problem. contentOffset will be zero if an user scroll to top.

1 Answer 1

1

Have you tried using contentInset in UIScrollView?

textView.contentInset = UIEdgeInsetsMake(55.0, 0, 0, 0);

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.