美文网首页
2018-09-07

2018-09-07

作者: 思念1992 | 来源:发表于2018-09-07 16:15 被阅读0次

    oc 圆角阴影设置 

    View.backgroundColor = [UIColor whiteColor]; 

    View.layer.shadowColor = HEXCOLOR(0x959595).CGColor;//阴影颜色    View.layer.shadowOffset = CGSizeMake(0, 0);//偏移距离    View.layer.shadowOpacity=0.15;//不透明度    

    View.layer.shadowRadius=10.0;//半径

    View.layer.cornerRadius=10; 圆角

    上边圆角 包括左边和右边

     View.backgroundColor = [UIColor whiteColor];    View.layer.shadowColor = HEXCOLOR(0x959595).CGColor;//阴影颜色

        View.layer.shadowOffset = CGSizeMake(0, 0);//偏移距离

        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:View.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)];

        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

        maskLayer.frame= View.bounds;

        maskLayer.path= maskPath.CGPath;

        View.layer.mask= maskLayer;

    下边圆角 包括左边和右边

      View.backgroundColor = [UIColor whiteColor];

        View.layer.shadowColor = HEXCOLOR(0x959595).CGColor;//阴影颜色

        View.layer.shadowOffset = CGSizeMake(0, 0);//偏移距离

        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:View.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(8, 8)];

        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

        maskLayer.frame= View.bounds;

        maskLayer.path= maskPath.CGPath;

        View.layer.mask= maskLayer;

    相关文章

      网友评论

          本文标题:2018-09-07

          本文链接:https://www.haomeiwen.com/subject/jpvcgftx.html