views:

512

answers:

3

I want to have a thin gray border around UITextView, I have gone through documentation but couldn't find any property there. Please help.

A: 

I don't think there is a way to do it in the SDK. Probably easiest if you just use an image and position it correctly to make it appear as though the text view has a border.

This forum thread might also be of use: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4864-adding-border-uitextview.html

pheelicks
A: 

You cant do it...A good option might be to draw your border (or use an image) of your border and put a UITextView on top of it with transparent background, this will make it seem as though the textview itself has the borders..also you can use a tableview and have a UITexstView in your tableview cell which will cause the textview to seem as it has a gray border but its really the tableviewcell.

Daniel
+5  A: 
#import <QuartzCore/QuartzCore.h>

....


view.layer.borderWidth = 5.0f;
view.layer.borderColor = [UIColor grayColor];
Kendall Helmstetter Gelner