zoukankan      html  css  js  c++  java
  • button只切其中几个圆角

    
    //无边框线
    
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.openGroupBtn.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight cornerRadii:CGSizeMake(radius,radius)];
    
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    
    maskLayer.frame = self.openGroupBtn.bounds;
    
    maskLayer.path = maskPath.CGPath;
    
    self.openGroupBtn.layer.mask = maskLayer;
    
    //有边框线
    
    UIBezierPath *rectPath=[UIBezierPath bezierPathWithRoundedRect:self.spellNumBtn.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(radius, radius)];
    
    CAShapeLayer *rectLayer=[CAShapeLayer layer];
    
    //线条颜色
    
    rectLayer.strokeColor=[UIColor colorWithHex:goldenYellow].CGColor;
    
    //填充颜色
    
    rectLayer.fillColor=[UIColor colorWithHex:CenColor].CGColor;
    
    //线条宽度
    
    rectLayer.lineWidth=1;
    
    //起始结束点的样式
    
    rectLayer.lineJoin=kCALineJoinRound;
    
    //线条拐角的样式
    
    rectLayer.lineCap=kCALineCapRound;
    
    rectLayer.path=rectPath.CGPath;
    
    [self.spellNumBtn.layer addSublayer:rectLayer];
  • 相关阅读:
    刷题笔记
    布隆过滤器
    单例模式,堆,BST,AVL树,红黑树
    B树、B-树、B+树、B*树【转】,mysql索引
    数据结构与算法80道
    海量数据处理【转】
    volcanol的工控博客
    volcanol的工控博客
    volcanol的工控博客
    volcanol的工控博客
  • 原文地址:https://www.cnblogs.com/idefei/p/7607214.html
Copyright © 2011-2022 走看看