方法一:直接使用UIView对应图层的cornerRadius self.layer.cornerRadius = CGRectGetWidth(self.bounds)/2.f; self.clipsToBounds = YES;方法二:使用图层遮罩 CAShapeLayer...
分类:
移动开发 时间:
2015-05-17 18:11:46
阅读次数:
439
用CAShapeLayer写股市K线图动画效果说明入市有风险,炒股需谨慎。(因项目需求,本人提供了写这种效果的源码)效果源码//// ViewController.m// Path//// Created by YouXianMing on 15/5/11.// Copyright (c) ...
分类:
其他好文 时间:
2015-05-11 23:44:24
阅读次数:
154
1. 代码示例- (void)viewDidLoad { [super viewDidLoad]; CAShapeLayer *shape = [CAShapeLayer layer]; UIBezierPath *bezierPath = [UIBezierPath bezierPathWi...
分类:
移动开发 时间:
2015-04-30 18:01:14
阅读次数:
297
#import @interface CircleProgressView : UIView/**起始值(0-1)*/@property(nonatomic,assign)CGFloat fstartValue;/**边框宽度*/@property(nonatomic,assign)CGFloat ...
分类:
其他好文 时间:
2015-04-01 17:21:36
阅读次数:
104
objc.io 学习 摘自原处修改对层的属性详细了解可见这里@interface ClockFace : CAShapeLayer@property (nonatomic, strong) NSDate *time;@end@interface ClockFace ()@property (nona...
分类:
其他好文 时间:
2015-03-31 21:40:58
阅读次数:
145
到目前为止,我们已经探讨过CALayer类了,同时我们也了解到了一些非常有用的绘图和动画功能。但是Core Animation图层不仅仅能作用于图片和颜色而已。本章就会学习其他的一些图层类,进一步扩展使用Core Animation绘图的能力。CAShapeLayer在第四章『视觉效果』我们学习到了...
分类:
移动开发 时间:
2015-03-05 18:45:58
阅读次数:
1022
动态实时设置CAShapeLayer贝塞尔曲线的坐标点效果图:源码:PathDirectionView.h 与 PathDirectionView.m//// PathDirectionView.h// Path//// Created by XianMingYou on 15/2/27.//...
分类:
其他好文 时间:
2015-02-28 00:05:26
阅读次数:
248
原创blog,转载请注明出处
blog.csdn.net/hello_hwc前言
这个系列的本身不是为了写一些东西让读者拿过去就直接可以用的。过段时间我会在github上传一些拿去就可以用的。这个系列的本身是希望抛砖引玉,提供一些自定义控件的思路。
本文的内容
阐述了实现自定义UIActivityIndicator的过程
希望通过本文,读者能够学会
CAShapeLayer的简单使用
CAGr...
分类:
移动开发 时间:
2015-02-17 12:57:30
阅读次数:
322
近期需要完成一个功能,就是要在屏幕上动态地完成绘制一个曲线。这个曲线可以用来完成描述数据在一定时间内的变化等。大概就是下面这个效果。
这个效果要如何来完成呢?需要用到这三个类 UIBezierPath CAShapeLayer 和 CABasicAnimation 。其中UIBezierPath用来绘制相应地曲线路径,CAShapeLayer用来为Path提供展示的位置,并...
分类:
移动开发 时间:
2015-02-12 16:13:10
阅读次数:
179
// 创建layer并设置属性 CAShapeLayer *layer = [CAShapeLayer layer]; layer.fillColor = [UIColor clearColor].CGColor; layer.lineWidth = 2.0f; laye...
分类:
其他好文 时间:
2015-02-05 21:42:47
阅读次数:
679