簡體   English   中英

Flutter - 無法從 Webview 下載文件

[英]Flutter - Can't download files from Webview

當我從 webview 中單擊任何下載按鈕時,它什么也不做。 我還沒有找到任何解決方案,所以我在這里問。 謝謝你。

What you have inside a webView can't be handled from the app, you load a url in your web view so everything goes inside the webView is related to the url that you have loaded. 例如,您可以對 web 視圖執行什么操作,例如通過滑動刷新來刷新它。 或通過以下方式處理 state:

inner class WebClientCustom : WebViewClient(){

    override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
        super.onPageStarted(view, url, favicon)
    }

    override fun onPageFinished(view: WebView?, url: String?) {
        super.onPageFinished(view, url)
    }

    @TargetApi(Build.VERSION_CODES.M)
    override fun onReceivedError(view: WebView?, request: WebResourceRequest?, error: WebResourceError?) {
    }

    @SuppressWarnings("deprecation")
    override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
    }

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM