문제

I have a UIView that originally is the size of 320x90

now I want to scale it, so I wrote

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

the problem is that now my view doesn't sit where I want it to sit, x,y wise

and any changes to its frame's origin does not change its location on the screen

how to put location on the screen after scaling ?

도움이 되었습니까?

해결책

How about doing another transform for your offset by using CGAffineTransformTranslate?:

myView.transform = CGAffineTransformTranslate(myView.transform, x, y);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top