viewDidLoad中的CGAffineTransformRotate拉伸/分散UIImageView(CGAffineTransformRotate in viewDidLoad stretches/distords the UIImageView)
我需要在加载视图时按接口构建器创建的UIImageView以给定角度旋转。
- (void)viewDidLoad { [super viewDidLoad]; image.transform = CGAffineTransformRotate(image.transform, REF_INIT_OFFSET*M_PI/180); }
这会旋转图像,但后者完全扭曲和拉伸。 如果REF_INIT_OFFSET是90的倍数,它工作正常!
这是图片的样子(注意指针指向“0”)
以下是它的实际外观:
看起来图像被拉伸到错误的方向。
你知道什么是错的吗?
谢谢,
I need to rotate by a given angle a UIImageView created by Interface builder when the view is loaded.
- (void)viewDidLoad { [super viewDidLoad]; image.transform = CGAffineTransformRotate(image.transform, REF_INIT_OFFSET*M_PI/180); }
This rotates the image but the latter is totally distorted and stretched. If REF_INIT_OFFSET is a multiple of 90 it works fine !
Here is how the picture should look like (note the needle pointing to the "0")
and here is how it actually looks:
it looks like the image is stretched into a wrong direction.
Do you have in idea what's wrong ?
thanks,
原文:https://stackoverflow.com/questions/6595613