Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bordered UITextView

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.

like image 517
Ali Avatar asked Sep 29 '22 06:09

Ali


2 Answers

#import <QuartzCore/QuartzCore.h>

....

// typically inside of the -(void) viewDidLoad method
self.yourUITextView.layer.borderWidth = 5.0f;
self.yourUITextView.layer.borderColor = [[UIColor grayColor] CGColor];
like image 313
Kendall Helmstetter Gelner Avatar answered Oct 23 '22 01:10

Kendall Helmstetter Gelner


Add the following for rounded corners:

self.yourUITextview.layer.cornerRadius = 8; 
like image 43
user542584 Avatar answered Oct 23 '22 03:10

user542584