开发者

CGAffineTransformMakeScale and CoreGraphics

I've got a UIView overriding the drawRect: method.

Now, when I'm doing

view.transform = CGAffineTransformMakeScale(recognizer.scale,1.0);

everything scales; the view itself as well as everything drawn on it.

But now I would like to only scale specific things drawn on it. Is it possible to draw to e.g. draw to two different layers and then scale only one specific layer?

Unfortunately, it's no option to take different views - that's performing a lot worse, I tried... (large UIScrollView with view above it, draw in the view above scrollView - scrolling is slow then - but if I draw to the UIScrollView directly, it performs good).

Thanks a LOT!

EDIT The second approach:

- UIWindow

-- UIView

--- UIScrollView <== this view should NOT resize in Transformation

---- UIView <== here, I draw some开发者_StackOverflow things on with CoreGraphics <== should be resized in Transformation

The view with core graphic objects on it has the same size as the UIScrollView.contentSize and always gets setNeedsDisplayInRect when the scrollview is scrolled... but for me, it's much slower...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜