小编use*_*000的帖子

Phonegap ChildBrowser插件:禁用/隐藏位置栏中的URL,但不是后退/前进/退出按钮

有没有办法隐藏或禁用位置栏中的URL字段?在我的情况下,设备是作为信息亭浏览器运行的平板电脑,因此只允许一个URL.

我通过将ChildBrowser.java中的代码更改为来修复此问题

private void navigate(String url) {
    InputMethodManager imm = (InputMethodManager)this.ctx.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
    if (!url.startsWith("http")) {
        this.webview.loadUrl("http://" + url);
    }
    this.webview.loadUrl("http://www.my-only-allowed-site.example.org");
    this.webview.requestFocus();
}
Run Code Online (Sandbox Code Playgroud)

这很好用,但不是很好.您仍然可以看到该网址.我希望有这些可能的解决方案:
1)完全隐藏URL字段
2)在点击URL字段时隐藏软键盘
3)将URL字体颜色设置为黑色

任何的想法?
提前致谢

android phonegap-plugins cordova

5
推荐指数
1
解决办法
1967
查看次数

标签 统计

android ×1

cordova ×1

phonegap-plugins ×1