我有一个UIScrollView
包含我想用纹理填充的子视图。
- (void)drawRect:(CGRect)rect {
CGImageRef image_to_tile_ret_ref = CGImageRetain(wood.CGImage);
CGRect tile_rect;
tile_rect.size = wood.size;
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0);
CGContextDrawTiledImage(context, tile_rect, image_to_tile_ret_ref);
// Something here to make it fill a big area
CGContextFillPath(context);
CGImageRelease(image_to_tile_ret_ref);
}
这似乎只是填充了滚动视图的可见区域,当我滚动时,其余部分是白色的。如何绘制超出矩形边界的矩形?那不好吗?