문제

I'm scaling an UIView this way:

myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);

and the view is scaled well, but I want one of its subview to remain unscaled, i.e fullscreen. How to achieve this?

도움이 되었습니까?

해결책 2

The only way is to add additional scaling for specific subview

myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);
specific.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1./0.9, 1./0.9);

probably you will also need to add

myView.clipsToBounds = NO;

다른 팁

I was able to get Avt's answer to work by using CGAffineTransformInvert:

myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9)
subView.transform = CGAffineTransformInvert(myView.transform)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top