views:

1716

answers:

2

Hi,

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.

A: 

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.

Kailoa Kadano
+2  A: 

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

lostInTransit