zoukankan      html  css  js  c++  java
  • 画圆圈

    画圆圈

    by 伍雪颖



    CGPoint CGRectGetCenter(CGRect rect){
       
    returnCGPointMake(CGRectGetMidX(rect),CGRectGetMidY(rect));
    }
    @interfaceViewController () {
       
    CAShapeLayer *circleLayer;
    }
    @property (nonatomic,strong)CADisplayLink *timer;
    @end
    @implementation ViewController

    - (
    void)viewDidLoad {
        [
    superviewDidLoad];
       
    circleLayer = [CAShapeLayerlayer];
       
    CGFloat radius =30.0;
       
    UIBezierPath *path = [UIBezierPathbezierPathWithArcCenter:CGRectGetCenter(self.view.frame)
                                                           
    radius:radius
                                                       
    startAngle:-0.5 * M_PI
                                                         
    endAngle:1.5 * M_PI
                                                        
    clockwise:YES];
       
    circleLayer.path = path.CGPath;
       
    circleLayer.strokeColor = [UIColorredColor].CGColor;
       
    circleLayer.lineWidth =3;
       
    circleLayer.fillColor =nil;
       
    circleLayer.contentsScale = [UIScreenmainScreen].scale;
        [
    self.view.layeraddSublayer:circleLayer];
    }

  • 相关阅读:
    HTTP 无法注册URL 进程不具有命名空间的访问权限
    逆变与协变详解
    正式学习React(五) react-redux源码分析
    正式学习React(四) ----Redux源码分析
    正式学习react(二)
    工作总结
    如何自定义echarts 线性图的选择事件
    viewport大白话
    关于div可编辑的复制粘贴问题
    nginx学习
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/5088801.html
Copyright © 2011-2022 走看看