开发者

Can the viewing area be judged by UIScrollView?

开发者 https://www.devze.com 2023-03-26 16:03 出处:网络
Can the viewing area be judged by UIScrollView? There\'s many ImageView in my开发者_StackOverflow UIScrollVer, I only hope that in the visible region for loading images UIImageView.

Can the viewing area be judged by UIScrollView?

There's many ImageView in my开发者_StackOverflow UIScrollVer, I only hope that in the visible region for loading images UIImageView.

How can I do?

thanks for any helps!


Just use your image size for the UIImage that holds the image and set that as your content size.

UIImage *myImage = [UIImage imageNamed:@"myImage.png"];
self.scrollView.contentSize = myImage.size;

Hope this helps.


The contentOffset property of UIScrollView shows the current viewing area.

0

精彩评论

暂无评论...
验证码 换一张
取 消