How to rotate sub-views around their own centres?

前端 未结 2 1042
长发绾君心
长发绾君心 2020-12-23 20:07

Is it possible to rotate a view around its own centre?

In my present implementation the sub-views (buttons, etc) seem to move along a funny path before they end up i

2条回答
  •  粉色の甜心
    2020-12-23 20:56

    You can manualy rotate any UIView subclass using transform property.

    #import 
    
    myView.transform = CGAffineTransformMakeRotation(M_PI/2);
    

提交回复
热议问题