Skip to content

一点小小的建议 #3

@iCytus

Description

@iCytus

在iOS真机上,打开文件时会有一闪而过的黑屏,这个体验不是很好,建议增加个背景颜色

  func openFile(filePath: String, webView: WKWebView)  {
      let url = URL(fileURLWithPath: filePath)
      webView.backgroundColor = UIColor.white  // 设置下背景颜色会好一些
      if #available(iOS 9.0, *) {
          webView.loadFileURL(url, allowingReadAccessTo: url)
      } else {
          let request = URLRequest(url: url)
          webView.load(request)
      }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions