码迷,mamicode.com
首页 > 其他好文 > 详细

添加一条边框

时间:2015-12-04 18:32:27      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:

#import <QuartzCore/QuartzCore.h>
- (void)viewDidLoad {
   CALayer *TopBorder = [CALayer layer];
   TopBorder.frame = CGRectMake(0.0f, 0.0f, myview.frame.size.width, 3.0f);    TopBorder.backgroundColor = [UIColor redColor].CGColor;
   [myview.layer addSublayer:TopBorder];  
[super viewDidLoad];
}
 
    //顶部line
        CALayer *topAdnBottom = [CALayer layer];
        topAdnBottom.frame = CGRectMake(0.0f, 0.0f, SCREEN_WIDTH, 1.0f);
        topAdnBottom.backgroundColor = LINE_CORLOR.CGColor;
        [startPlayView.layer addSublayer:topAdnBottom];
        //尾部line
        CALayer *bottomBorder = [CALayer layer];
        bottomBorder.frame = CGRectMake(0.0f, startPlayView.frame.size.height - 1, SCREEN_WIDTH, 1.0f);
        bottomBorder.backgroundColor = LINE_CORLOR.CGColor;
        [startPlayView.layer addSublayer:bottomBorder];

添加一条边框

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/5019869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!