在view扣除正方形
时间:2014-04-29 13:33:22
收藏:0
阅读:284
- (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(ctx, .3, .3, .3, .1); CGContextFillRect(ctx, self.bounds); CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor); CGContextStrokeRectWithWidth(ctx, _clearRect, 2); CGContextClearRect(ctx, _clearRect); }项目中遇到一个遮罩层的问题,整个view浅灰色中间一块为透明色,能看到下面view上显示的内容!
评论(0)