简体   繁体   中英

Stretchable UIImage and CGAffineTransform

I've got a UIScrollView whose zoom behavior I want to confine to the horizontal axis. I've accomplished that through using a custom UIView as the viewForZoomingInScrollView: and overriding setTransform: . So far so good – the view only zooms horizontally.

One catch: The container view includes some stretchable UIImage instances in UIImageView s. Obviously, with the transform in effect, the images distort.

What's the best bet for either redrawing the view so that the images aren't distorted, or, zooming the view in such a way as to not require transforms in the first place?

Thanks for any help you can offer.

您确定实现此目标的方法是使UIImageView成为自定义UIView,并使其drawRect:代码做正确的事情:绘制拉伸和未拉伸的元素。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM