How to get CGAffineTransformMakeScale to reduce the view around its center?

It should be easy: when I use CGAffineTransformMakeScaleon UIViewwith width = 0.5and height = 0.5, it shrinks in the upper left corner. I need him to shrink around his center.

How can i achieve this?

+3
source share
3 answers

Be sure to turn off autorun if you experience the same behavior!

+3
source
Yeah, I got it. I did some custom drawing and mixed frames and frames.
0
source

CGAffineTransformMakeScale UIView .

:

[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationCurveEaseInOut animations:^{
    self.myView.transform = CGAffineTransformMakeScale(2, 2);
}  completion:nil ]; 

.. myView , .

0
source

Source: https://habr.com/ru/post/1743895/


All Articles