1 - (void)drawRect:(CGRect)rect 2 { 3 // Drawing code 4 5 // 画圆, 以便于以后指定可以显示内容范围 6 CGContextRef ctx = UIGraphicsGetCurrentContext();...
分类:
移动开发 时间:
2016-01-23 01:21:09
阅读次数:
234
1 - (void)drawRect:(CGRect)rect 2 { 3 // 获取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 保存一份最纯洁的图形上下文 7 // 调用一次该方法...
分类:
移动开发 时间:
2016-01-22 21:45:32
阅读次数:
192
1 @interface NJTextImage : UIView 2 @end 3 4 5 @implementation NJTextImage 6 7 - (void)drawRect:(CGRect)rect 8 { 9 // [self test];10 // ...
分类:
移动开发 时间:
2016-01-22 16:58:41
阅读次数:
144
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect这个方法用来设置rect范围内所有的item的属性值UICollectionViewLayoutAttributes:用来表示任意一个item属性- (CGPoint)targetC...
分类:
其他好文 时间:
2016-01-21 23:28:27
阅读次数:
194
-(UIImage*)createImageWithColor: (UIColor*) color{ CGRect rect=CGRectMake(0,0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGContextRef co...
分类:
其他好文 时间:
2016-01-21 18:39:57
阅读次数:
115
let termsAndPrivacyLabel = UITextView(frame: CGRect(x: 24/2, y: 0, width: width, height: height)) let string = "By signing up, you agree to...
分类:
其他好文 时间:
2016-01-20 19:22:58
阅读次数:
115
(四)内主要讲了绘制状态的保存与恢复本次主要讲述 缩放,旋转,平移等操作5.附加操作 5.1 旋转 TIP: 旋转操作主要是对本次渲染的图层进行旋转,旋转的中心为左上角顶点- (void)drawRect:(CGRect)rect { //获取上下文 CGContextRef ctx = U...
分类:
其他好文 时间:
2016-01-20 11:11:30
阅读次数:
135
(一)内主要就是讲了线条的绘制以及绘制状态的保存与恢复本次就讲一些图形的画法2 图形的绘制 2.1 三角形的绘制 :(就是绘制三条线)- (void)drawRect:(CGRect)rect { //获取绘制上下文 CGContextRef ctx =UIGraphicsGetCurren...
分类:
其他好文 时间:
2016-01-19 21:00:53
阅读次数:
160
CGRect rect = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphi.....
分类:
其他好文 时间:
2016-01-19 10:28:10
阅读次数:
148
-(UIImage *)captureScreenWithRect:(CGRect)rect{ UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 1); [self.view.layer renderInCont.....
分类:
移动开发 时间:
2016-01-19 10:16:44
阅读次数:
204