Ozgur Vatansever
Ozgur Vatansever

Reputation: 52143

UITextView's Text Overlaps When Scrolled

I have a UILabel and UITextView added into a UIViewController's view like in the screenshot below.

enter image description here

When I typed some words and uitextview starts scrolling, it overlaps the title of the label like below.

enter image description here

I tried to set textView's textContainerInset but it didn't work as I expected. It started the text 10pt below the normal position but still overlapped when it was scrolled.

textView.textContainerInset = UIEdgeInsetsMake(10, 0, 0, 0);

Upvotes: 0

Views: 519

Answers (1)

Rashad
Rashad

Reputation: 11197

It seems that you have place TextView upon UILabel. Move the UILabel up or TextView down, hope that will solve the problem.

 CGRect frame = theLabel.frame;
 frame.origin.y = frame.origin.y - 20;
 theLabel.frame= frame;

This will move the label 20px up.

Hope this helps... :)

Upvotes: 1

Related Questions