[英]I want to disable a Image in webview. I think we can block the URL of image from loading, but How to achieve it
[英]I need to fill text field programatically in a web page opened inside a WebView. How To?
我創建了一個WebView並在其中打開了一個包含表單的網頁。 我需要以編程方式填寫該表格(需要從sqlite數據庫獲取一些數據並填寫它)。
我該怎么做? 誰能幫幫我。
編輯:該網頁是一個注冊表單,我不擁有該網頁。.我無法將Java腳本添加到該網頁中。
在這種情況下,我會使用javascript。
這是怎么回事。 使您的webview啟用javascript。
Webview活動中的Java代碼
webview.loadUrl("javascript: fillUpForm(inputId,inputValue)");
html文件中的javascript
function fillUpForm(id,value)
{
document.findElementById(id).value=value;
}
坦白說,我不是javascript方面的專家。 但這應該為您提供起點。
好吧,就您而言
我會嘗試這個
view.loadUrl("javascript:(function(){document.getElementById('trop').value='some value';})()");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.