[ios]代码库
#import <UIKit/UIKit.h>
@interface MyView : UIView
@end
#import "MyView.h"
@implementation MyView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context, 333, 0);
CGContextAddCurveToPoint(context, 333, 0, 332, 26, 330, 26);
CGContextAddCurveToPoint(context, 330, 26, 299, 20, 299, 17);
CGContextAddLineToPoint(context, 296, 17);
CGContextAddCurveToPoint(context, 296, 17, 296, 19, 291, 19);
CGContextAddLineToPoint(context, 250, 19);
CGContextAddCurveToPoint(context, 250, 19, 241, 24, 238, 19);
CGContextAddCurveToPoint(context, 236, 20, 234, 24, 227, 24);
CGContextAddCurveToPoint(context, 220, 24, 217, 19, 216, 19);
CGContextAddCurveToPoint(context, 214, 20, 211, 22, 207, 20);
CGContextAddCurveToPoint(context, 207, 20, 187, 20, 182, 21);
CGContextAddLineToPoint(context, 100, 45);
CGContextAddLineToPoint(context, 97, 46);
CGContextAddCurveToPoint(context, 97, 46, 86, 71, 64, 72);
CGContextAddCurveToPoint(context, 42, 74, 26, 56, 23, 48);
CGContextAddLineToPoint(context, 9, 47);
CGContextAddCurveToPoint(context, 9, 47, 0, 31, 0, 0);
CGContextStrokePath(context);
}
@end
[代码运行效果截图]
中级程序员
by: 东城 发表于:2016-05-12 09:33:54 顶(0) | 踩(0) 回复
回复评论