CGAffineTransformMakeScale animation not working

后端 未结 2 1891
梦毁少年i
梦毁少年i 2021-02-07 21:04

I have a viewcontroller with a view that I am dismissing using a UIView animation to scale it down to 0 before removing it. My code for dismissing it is:

[UIView         


        
相关标签:
2条回答
  • 2021-02-07 21:34

    If acceptable for you, set the scale values to 0.01 like so:

    _menuContainerView.transform = CGAffineTransformMakeScale(0.01, 0.01);

    Reference

    0 讨论(0)
  • 2021-02-07 21:53

    So after speaking with a developer at Apple the reasoning I got back was that some base frameworks need to work with the inverses of transform matrices quite often, and since there is no inverse for the zero matrix the animation just returns out to avoid crashing. Hopefully this post has helped others who ran into a similar situation.

    0 讨论(0)
提交回复
热议问题