0
我有一個UIScrollView
,其中包含我想填充紋理的子視圖。如何在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);
}
這似乎填充滾動視圖的可見區域,當我滾動時,其餘是白色的。我如何在矩形的邊界之外畫一個矩形?那不好嗎?
太好了,謝謝! – 2010-07-10 13:16:39