Frage

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 ?

War es hilfreich?

Lösung

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

myView.transform = CGAffineTransformTranslate(myView.transform, x, y);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top