Abhinav
Abhinav

Reputation: 38162

How to set padding in UIText view

Any clue on how to set padding on left/right/top/bottom of a UITextView?

Upvotes: 2

Views: 704

Answers (2)

Abhinav
Abhinav

Reputation: 38162

This can be achieved with this set of code:

self.myTextView.pagingEnabled = YES;
UIEdgeInsets aUIEdge = [self.myTextView contentInset]; 
aUIEdge.left = 30;
aUIEdge.right = 30;
aUIEdge.top = 10;
aUIEdge.bottom = 10;

self.myTextView.contentInset = aUIEdge;

You will get left/right/top/bottom paddings.

Upvotes: 3

Vinzius
Vinzius

Reputation: 2901

Mmmm I never saw a padding property in the UITextView object. But maybe you just could do it by setting different valu to the textView frame ;-)

Upvotes: 0

Related Questions