zoukankan      html  css  js  c++  java
  • ios画曲线

    画曲线:

    - (void)drawRect:(CGRect)rect {
        UIBezierPath *path = [UIBezierPath bezierPath];
        [path moveToPoint:CGPointMake(140, 40)];
        //添加两个控制点 和 终点
        [path addCurveToPoint:CGPointMake(40, 180) controlPoint1:CGPointMake(40, 40) controlPoint2:CGPointMake(140, 180)];
        
        [path addCurveToPoint:CGPointMake(140, 320) controlPoint1:CGPointMake(140, 180) controlPoint2:CGPointMake(40, 320)];
        
        [[UIColor redColor]setStroke];
        [path stroke];
    

    //绘制矩形

        UIBezierPath *rectPath = [UIBezierPath bezierPathWithRect:CGRectMake(50, 50, 200, 80)];
        rectPath.lineWidth = 5;
        [[UIColor greenColor] setStroke];
        [rectPath stroke];
        ```
    
    //绘制圆角矩形
    
    UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(50, 150, 200, 80) cornerRadius:20];
    [roundedRect stroke];
    
        
    //绘制椭圆
    
    UIBezierPath *oval = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 250, 200, 80)];
    [oval stroke];
    

    }

    成功的三大原则: 1、坚持 2、不要脸 3、坚持不要脸
  • 相关阅读:
    布局
    面向对象....(概况)
    下拉城市列表
    下拉列表
    内容窗体
    《面向对象》-继承
    《面向对象》--类
    《面向对象》第一讲
    常用的正则表达式
    正则表达式
  • 原文地址:https://www.cnblogs.com/xulinmei/p/7420269.html
Copyright © 2011-2022 走看看