开发者

iOS SDK: UITextField Custom Bottom Border

开发者 https://www.devze.com 2023-03-13 03:43 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消