- (void)drawRect:(CGRect)rect
{
    // draw a rounded rect bezier path filled with blue
    CGContextRef aRef = UIGraphicsGetCurrentContext();
    CGContextSaveGState(aRef);
    UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:5.0f];
    bezierPath.lineWidth = 5.0f;
    [[UIColor blackColor] setStroke];
 
    UIColor *fillColor = [UIColor colorWithRed:0.529 green:0.808 blue:0.922 alpha:1]; // color equivalent is #87ceeb
    [fillColor setFill];
 
    [bezierPath stroke];
    [bezierPath fill];
    CGContextRestoreGState(aRef);
}

IOS画线条的更多相关文章

  1. Word画线条5大技巧,简单实用!

    [Word画线条5大技巧,简单实用!]1.输入三个“=”,回车,就是一条双直线:2.输入三个“~”,回车,就是一条波浪线:3.输入三个“”回车,就是一条虚线:4.输入三个“-”,回车,就是一条直线:5 ...

  2. iOS画折线图

    代码例子效果:  下载地址:http://download.csdn.net/detail/qqmcy/6983187 LineChartViewDemo.h #import <UIKit/UI ...

  3. iOS 画虚线

    UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(, , , )]; [self.view addSubvi ...

  4. iOS 画平滑曲线的方法及取音频数据的方法

    源码:http://files.cnblogs.com/ios8/iOS%E5%BF%83%E7%94%B5%E5%9B%BEDemo.zip 取音频数据和画波形图的方法 ViewController ...

  5. visio中怎样画线条或箭头

    1.在"画图"工具栏上,单击"铅笔"工具  或"线条"工具  . (凝视   假设看不到"画图"工具栏,请单击" ...

  6. [ios]ios画线 使用CGContextRef,CGPath和UIBezierPath来绘画

    参考 :http://www.mgenware.com/blog/?p=493 这三种东西:CGContextRef,CGPath和UIBezierPath.本质上都是一样的,都是使用Quartz来绘 ...

  7. iOS 画圆图片的几种方法

    方法一: self.cycleImv= [[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 50, 50)]; [self.view addS ...

  8. iOS 画环形图

    由于新项目的的需求,需要画环形图,由于以前都没接触过这一类(我是菜鸟),去cocochina山找到了一个案例,个人觉得还可以,分享一下 github 地址https://github.com/zhou ...

  9. iOS 画圆形头像

    demo下载地址:http://pan.baidu.com/s/1mgBf6YG _logoImageView.image = [self getEllipseImageWithImage:[UIIm ...

随机推荐

  1. POJ3624(01背包:滚动 实现)

    Charm Bracelet Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 30417   Accepted: 13576 ...

  2. Ubuntu 无法登录 coursera 看视频

    修改 host 文件 sudo vim /etc/hosts 将下面的内容添加至末尾 52.84.246.72 d3c33hcgiwev3.cloudfront.net

  3. 如何正确遍历删除List中的元素,你会吗?

    遍历删除List中的元素有很多种方法,当运用不当的时候就会产生问题.下面主要看看以下几种遍历删除List中元素的形式: 1.通过增强的for循环删除符合条件的多个元素 2.通过增强的for循环删除符合 ...

  4. B - School Marks

    Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description Little ...

  5. E - Jolly Jumpers

    E - Jolly Jumpers Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit  ...

  6. python数据分析笔记中panda(2)

    1 将手机号码分开为运营商,地区和号码段 from pandas import read_csv; df = read_csv("H:\\pythonCode\\4.6\\data.csv& ...

  7. TypeScript完全解读(26课时)_20.声明文件

    首先学习识别已有的js库的类型 识别已有的js库的类型 UMD既可以作为全局库使用,也可以作为模块使用 先在着手来编写一个全局的库 新建文件 接收一个title,改变页面title的值 这里用到 &a ...

  8. Laravel中使用模型对数据进行操作

    public function orm(){ //查询表的所有记录 //$user = Admin::all(); //dd($user); //查询某一条记录 //$user = Admin::fi ...

  9. Swift3.0 Alamofire网络请求的封装(get,post,upload图片上传)转

    转自: http://blog.csdn.net/C_calary/article/details/53193747 学习Swift 试着动手写个天气小app,搜集资料这个封装还蛮好用的. 我用的第三 ...

  10. hdu1158【DP】

    题意: 第一行项目数: 第二行每个工人的Hire Salary Fire money 第三行每个项目需要的人的数量: 工人在hire/fire的时候要付出额外的钱,如果已经hire了还没有fire就一 ...