如何设置 UIImageView 的动画和调整其大小?我试过这样做,但对我来说没有用:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
imgView.frame = CGRectMake(0, 0, 320, 480);
[UIView commitAnimations];
最佳答案
尝试使用 block 动画:
[UIView animateWithDuration:1.0f // This can be changed.
animations:^{
CGRect frame = imageView.frame;
frame.size.width += 100.0f; // This is just for the width, but you can change the origin and the height as well.
imageView.frame = frame;
}
completion:^(BOOL finished){
}];
希望对您有所帮助!
关于iphone - 动画和调整 UIImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8842623/