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];
  • 相关阅读:
    Swift # Apple Pay集成
    GitHub Top 100 简介
    一些常用算法
    CocoaPods 建立私有仓库
    安装 CocoaPods & Alcatraz
    iOS程序 # 启动过程
    Apache & WebDav 配置(二)
    SVN & Git (二)
    SVN & Git (一)
    poj 3169 Layout (差分约束)
  • 原文地址:https://www.cnblogs.com/idefei/p/7607214.html
Copyright © 2011-2022 走看看