//可以通过代码创建或者绑定到storyboard上的UIView
DrawView *drawView=[[DrawView alloc] init];
drawView.frame=CGRectMake(0, 100, self.view.bounds.size.width, 300);
[self.view addSubview:drawView];
//设置画板背景颜色
drawView.backgroundColor=[UIColor blackColor];
//设置画笔宽度
drawView.lineWidth=5;
//设置画笔颜色
drawView.lineColor=[UIColor redColor];
belong571 / drawview Goto Github PK
View Code? Open in Web Editor NEWDrawView