Вопрос

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