gpt4 book ai didi

ios - 在 UIImageView 中滑动大图像

转载 作者:行者123 更新时间:2023-11-29 10:24:48 26 4
gpt4 key购买 nike

我有一张宽度为 1000 像素的大图片。我想以原始大小显示图像,并希望它在动画中自动从右向左滚动。例如在iPhone 6中应该先显示375px,然后向左移动,直到照片的所有部分都及时显示出来。我该怎么做?

最佳答案

// You have to put the imageView inside a UIScrollView
// Set the duration you want for your animation
[UIView animateWithDuration:1.5f animations:^{
//Code for animation
[scrollView setContentOffset:CGPointMake(imageView.frame.size.width - scrollView.frame.size.width, scrollView.contentOffset.y) animated:NO];
} completion:^(BOOL finished) {
//Code after the animation is completed
}];

关于ios - 在 UIImageView 中滑动大图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32891832/

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