想知道如何转移UILabel

Ray*_*onK 1 xcode objective-c

我很抱歉,如果对这个问题有一个愚蠢的简单回答,但我一直在网上寻找一个直接,简单的答案,并没有真正得到一个.我想做的就是在iPad屏幕上将UILabel从一个地方转移到另一个地方.我不希望它是瞬间的,我希望它是动画的,所以我该怎么做?任何帮助(对愚蠢的问题有很多耐心^ _ ^;)将不胜感激!

Ada*_*ght 5

[UIView beginAnimations:@"myMoveAnimation" context:nil];  
aUIButton.center = CGMakePoint(newX, newY);
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)

对于lambda爱好者......

[UIView animateWithDuration:secondsToTake delay:0
        options: UIViewAnimationOptionCurveEaseIn
        animations:^{
          aUIButton.center = CGPointMake(newX, newY);
        }
        completion:^(BOOL finished){ /* Some code for to run when complete /* }];
Run Code Online (Sandbox Code Playgroud)