码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发小技巧

时间:2016-06-08 12:25:17      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

 UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
//    lab.layer.borderColor = [UIColor blueColor].CGColor;
//    lab.layer.borderWidth = 1;
//    lab.clipsToBounds = YES;
//    lab.layer.cornerRadius= 5;
    lab.backgroundColor = [UIColor blueColor];
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:lab.bounds byRoundingCorners:UIRectCornerTopLeft cornerRadii:CGSizeMake(19,19)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
    maskLayer.frame = lab.bounds;
    maskLayer.path = maskPath.CGPath;
    lab.layer.mask = maskLayer;
    [self.view addSubview:lab];

iOS开发小技巧

标签:

原文地址:http://www.cnblogs.com/wenqianww/p/5569417.html

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