-
-
Save qy1010/be3d245a7057f428618b92cd887065d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIView *myView = [[UIView alloc] init]; | |
myView.frame = CGRectMake(0, 0, 50, 50); | |
myView.backgroundColor = [UIColor blackColor]; | |
[self.view addSubview:myView]; | |
[UIView animateWithDuration:2.0 animations:^{ | |
// 2 秒内向右移动 100, 向下移动100。 | |
myView.transform = CGAffineTransformMakeTranslation(100, 100); | |
} completion:^(BOOL finished) { | |
// 动画完成后的回调 | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment