Bordered UITextView

Ali picture Ali · Apr 15, 2010 · Viewed 80.3k times · Source

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

Answer

Kendall Helmstetter Gelner picture Kendall Helmstetter Gelner · Apr 16, 2010
#import <QuartzCore/QuartzCore.h>

....

// typically inside of the -(void) viewDidLoad method
self.yourUITextView.layer.borderWidth = 5.0f;
self.yourUITextView.layer.borderColor = [[UIColor grayColor] CGColor];