Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一点小小的建议 #3

Open
iCytus opened this issue Sep 5, 2022 · 1 comment
Open

一点小小的建议 #3

iCytus opened this issue Sep 5, 2022 · 1 comment

Comments

@iCytus
Copy link

iCytus commented Sep 5, 2022

在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)
      }
  }
@yjt1216
Copy link

yjt1216 commented Dec 29, 2022

6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants