有没有办法修改警告框的标题?任何帮助将不胜感激。 :)
最佳答案
事实上,您可以使用以下代码将其包围起来:
final Context myApp=this;
webView.setWebChromeClient(new WebChromeClient(){
@Override
public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result)
{
new AlertDialog.Builder(myApp)
.setTitle("Simmon says...")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener()
{
public void onClick(DialogInterface dialog, int wicht)
{
result.confirm();
}
}).setCancelable(false)
.create()
.show();
return true;
};
});
代码源here
gl
关于javascript - 修改 alert() 标题(Android Webview 中的 Javascript),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10635563/