UIView animation

前端 未结 5 2061
醉话见心
醉话见心 2020-12-30 18:00

I am trying to animate a UIView here. It looks like a rectangle, and I just want to translate it to my coordinations.

So, how can I animate it? I tried

5条回答
  •  -上瘾入骨i
    2020-12-30 18:34

    In iOS 4, the UIView block animation method is easiest:

    [UIView animateWithDuration:1.0 animations:^{
        myView.frame = myNewFrameRect;
    }];
    

    http://developer.apple.com/library/ios/documentation/uikit/reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/clm/UIView/animateWithDuration:animations:

提交回复
热议问题