【问题标题】:How to show an image while my files (most images) are loading?如何在我的文件(大多数图像)加载时显示图像?
【发布时间】:2014-02-27 15:24:48
【问题描述】:

我正在制作一个带有 webview 加载我的 html 页面的应用程序。它有很多图像,我需要在应用程序启动时全部加载。

在我的 HTML 文件加载所有图像时,有什么方法可以显示图像?

【问题讨论】:

    标签: ios iphone uiwebview loading


    【解决方案1】:

    当然 - 只需将 UIImageView 添加到您的视图中,将其放在前台,在其中显示您的图像,当您的 Web 视图完成加载时(在 webViewDidFinishLoad 委托中),混合 UIImageView

    【讨论】:

      【解决方案2】:

      //在你的imageView中设置一张图片并把它从隐藏中移除,设置webview隐藏

      dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(队列, ^{

      //在这里加载你的html页面代码

      }

      dispatch_sync(dispatch_get_main_queue(), ^{
      

      //将您的图像视图设置为隐藏并显示您的网络视图。

      }); });

      【讨论】:

        猜你喜欢
        • 2010-12-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-26
        • 2014-02-26
        相关资源
        最近更新 更多