小编cha*_*rly的帖子

如何绘制矩形?

我想在viewContoller的视图中绘制填充矩形.我在viewDidLoad中写了下面的代码.但没有变化.怎么了?

CGRect rectangle = CGRectMake(0, 100, 320, 100);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextFillRect(context, rectangle);
Run Code Online (Sandbox Code Playgroud)

iphone objective-c drawrect

15
推荐指数
2
解决办法
3万
查看次数

标签 统计

drawrect ×1

iphone ×1

objective-c ×1