iOS SDK: UITextField Custom Bottom Border
I need to make a view with a textfield-textview-textfield-keyboard layout. I'd like to have them all divided by a border like this开发者_StackOverflow社区 tumblr view.
Any ideas on how to accomplish this?
You need to access the layer
property of UIView
.
Import the QuartzCore.h
header file.
#import <QuartzCore/QuartzCore.h>
Use the below code to set the border and its width.
myView.layer.borderColor = [UIColor grayColor].CGColor;
myView.layer.borderWidth = 3.0f;
#import <QuartzCore/QuartzCore.h>
textView.layer.borderWidth = 3.0f;
textView.layer.borderColor = [[UIColor grayColor] CGColor];
You can use three20 to accomplish this
精彩评论