在 iOS 中淡入异步加载的图像
我正在尝试找到一种异步加载图像的方法,然后让图像淡入,而不是让图像“仅出现”在 UIImageView 中,类似于 iPad 上 YouTube 应用程序的做法。
有谁知道我会如何做到这一点?我尝试四处寻找做过类似事情的人,但还没有太多运气,而且不太确定从哪里开始。
I'm trying to find a way to asynchronously load an image and then instead of having the images "just appear" in a UIImageView, have them fade in, similar to how it's done on the YouTube app on the iPad.
Does anyone have a clue on how I would do this? I've tried searching around for someone who has done something similar, but haven't had much luck yet and am not really sure where to get started.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也必须推出自己的解决方案。我从 这个 UIImageViews 异步加载教程开始(虽然它讨论的是表视图中的图像,但相同的原则通常适用于图像视图。
就淡入淡出部分而言,该代码块看起来像:
I had to roll my own solution as well. I started with this tutorial for async loading of UIImageViews (although it's talking about images in table views, the same principles apply to image views in general.
As far as the fade in part, that code block would look something like: