7

I'm trying to scale an UIView without scaling its subviews, or in my case I just want the subviews to be scaled in one axis. I need these hierarchy because I'm setting some Gesture Recognizers to detect panning and rotation and I want these to happen simultaneously with the parent view.

However, I don't want the scaling to happen simultaneously. For some subviews I want it to happen only vertically or horizontally or no scaling at all.

Is there a way to control the auto-scaling in an UIView's subviews when using CGAffineTransform on the UIView?

4

2 回答 2

4

如果您确保正确设置了子视图的 autoresizingMask,您可以更改容器 UIView 的框架(它是可动画的)并且子视图不会改变大小(如果您的调整大小掩码正确)。关闭 containerView.autoresizesSubviews 并更改框架也应该有效。

于 2011-07-10T08:16:04.410 回答
0

Set the view's autoresizesSubviews to NO, by default it's YES.

于 2011-07-09T17:45:06.897 回答