Ilya Suzdalnitski
Ilya Suzdalnitski

Reputation: 53540

UITextView - how to make it look like in the IB?

I am initializing a text view from my code, not from the interface builder and it appears to be just a white rectangle. I want it to have the same rounded shape as is in the interface builder. How can I achieve this?

The same question concerning UITextView.

Thanks.

Upvotes: 0

Views: 2456

Answers (2)

lostInTransit
lostInTransit

Reputation: 70997

The text view is rectangular even in IB. A UITextField has rounded corners. For that, just set the borderStyle property of UITextField to UITextBorderStyleRoundedRect

Upvotes: 2

amattn
amattn

Reputation: 10065

You maybe confusing UITextView with UITextField.

UITextField has a optional rounded rectangle border. UITextView is just the text, no border. You have to bring your own border to the party and place it behind the UITextView.

Upvotes: 1

Related Questions