iOS 画线
来源:互联网 发布:mac 上传图片失败 反复 编辑:程序博客网 时间:2024/05/22 15:46
@interface ShowLineView : UIView
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineCap(context, kCGLineCapSquare);//设置线条样式
CGContextSetLineWidth(context, 0.2); //设置线条粗细宽度
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor); //设置颜色
CGContextBeginPath(context); //开始一个起始路径
CGContextMoveToPoint(context, 10, 30); //起始点设置为(0,0):注意这是上下文对应区域中的相对坐标,
CGContextAddLineToPoint(context, 300, 30); //设置下一个坐标点
CGContextStrokePath(context); //连接上面定义的坐标点
}
-----------------
-(void)showLine{
ShowLineView *view = [[ShowLineView alloc] initWithFrame:CGRectMake(0, 30, 320, 100)];
view.backgroundColor = [UIColor cyanColor];
[self.view addSubview:view];
}
ShowLineView *view = [[ShowLineView alloc] initWithFrame:CGRectMake(0, 30, 320, 100)];
view.backgroundColor = [UIColor cyanColor];
[self.view addSubview:view];
}
0 0
- ios画线
- IOS 画线
- iOS 画线
- IOS 画线
- iOS 画线
- iOS 画线
- iOS画线
- iOS画线
- 画线 ios
- iOS 画布:画线条
- [IOS]画线/画圆
- IOS画线条
- [iOS]画线功能实现
- IOS 画图 画线
- iOS 之画线画图
- IOS画线的问题
- iOS 使用UIBezierPath画线
- [IOS]画线/画圆
- Linux添加/删除用户和用户组
- android游戏引擎初探
- 数据结构实验1
- Windows8 解决VMware与Hyper-V不兼容共存方法
- 十月百度,阿里巴巴,迅雷搜狗最新面试七十题(第201-270题)(2011年度十月上旬七十题)
- iOS 画线
- page request session application 作用范围
- C程序内存分配
- iPhone/iPad的IAP防破解之第三方服务器二次验证
- 使用mybatis_generatoer工具后出现Result Maps collection already contains value for BaseResultMap
- SASL authentication failed using mechanism DIGEST-MD5
- Linux系统调用
- Qt for ios开发:Xcode6、Qt5.3.2问题
- MySQL索引的作用