首页 > 移动平台 > 详细

iOS UITextField 设置下底边

时间:2016-06-12 20:09:13      阅读:143      评论:0      收藏:0      [点我收藏+]
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(30, 100, 160, 30)];
    
    textField.text = @"设置textField下边框";
    CALayer *bottomBorder = [CALayer layer];
    bottomBorder.backgroundColor = [UIColor orangeColor].CGColor;
    bottomBorder.frame = CGRectMake(0.0f, textField.frame.size.height - 1, textField.frame.size.width, 1.0f);
    bottomBorder.backgroundColor = [UIColor blackColor].CGColor;
    [textField.layer addSublayer:bottomBorder];
    [self.view addSubview:textField];
    [self.view setBackgroundColor:[UIColor lightGrayColor]];
}

@end

 

 

iOS UITextField 设置下底边

原文:http://www.cnblogs.com/poky/p/5578499.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!