How do you add a border around a UITextView (like a UITextField)? I want to allow users to type multiple lines, but unfortunately a UITextField does not support this. Is there an easy way to do this in code or do I need to create one in Photoshop?
#import <QuartzCore/QuartzCore.h>
Import the above framework and include these lines in your class where textview is defined.
[[self.textview layer] setBorderColor:[[UIColor grayColor] CGColor]]; [[self.textview layer] setBorderWidth:2.3]; [[self.textview layer] setCornerRadius:15];
Swift solution.
self.textview.layer.borderColor = UIColor.gray.cgColor self.textview.layer.borderWidth = 2.3 self.textview.layer.cornerRadius = 15
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With