我试图在我的UIView中绘制一个有黑色边框的透明矩形.
然而,我的代码创建了一个完全黑色的矩形.这是我的代码到目前为止
- (void)drawRect:(CGRect)rect { // Drawing code CGRect rectangle = CGRectMake(0,100,320,100); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context,0.0,0.5); CGContextSetRGBstrokeColor(context,0.5); CGContextFillRect(context,rectangle); }