zoukankan      html  css  js  c++  java
  • Drawing a circle

    - (void)drawRect:(CGRect)rect {

    CGFloat lineWidth = 2;
    CGRect borderRect = CGRectMake(self.frame.size.width/2, self.frame.size.height - 20, 10.0, 10.0);
    borderRect = CGRectInset(borderRect, lineWidth * 0.5, lineWidth * 0.5);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetRGBStrokeColor(context, 85.0/255.0, 143.0/255.0, 220.0/255.0, 1.0);
    CGContextSetRGBFillColor(context, 5.0/255.0, 43.0/255.0, 20.0/255.0, 1.0);
    CGContextSetLineWidth(context, 2.0);
    CGContextFillEllipseInRect (context, borderRect);
    CGContextStrokeEllipseInRect(context, borderRect);
    CGContextFillPath(context);
    }

  • 相关阅读:
    Title
    Title
    Title
    Title
    Title
    Title
    Title
    Title
    Title
    git 的使用
  • 原文地址:https://www.cnblogs.com/qike/p/4647413.html
Copyright © 2011-2022 走看看