gpt4 book ai didi

iphone - 动画和调整 UIImageView

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:51:34 26 4
gpt4 key购买 nike

如何设置 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com