开发者

UIScrollView and CATiledLayer

I am using a CATiledLayer as content of UIScrollView, but seems I can not get the correct (sometimes) [scrollView contentSize] and [scrollView contentOffset] from CATiledLayer's delegate method :

- (void)drawLayer:(CALayer *)laye开发者_如何学编程r inContext:(CGContextRef)ctx

I know CATiledLayer uses this method to render tile in a background thread. And I need to use contentSize and contentOffset to calculate some data (some coordinates). The app ran fine on simulator but on device, it sometimes got the wrong contentSize and contentOffset


CATiledLayer does not calculate these values for you, you have to set them.

note that for the tile size it does not apply contentScale. So on Retina the individual tiles are half as big as you specify.

If you still want an answer for this you have to clarify the question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜