4
A
回答
0
是的,使用<WebView />
标签在xml布局中执行此操作。
9
是如上使用web视图标签:
<WebView android:id="@+id/webview"
android:layout_width="fill_parent" android:layout_height="50dip"/>
的示例应用程序可以在这里找到: http://www.androiddom.com/2011/04/creating-android-calculator-tutorial.html
作者创建使用其在main.xml中指定的web视图计算器布局。
0
,并在代码中输入:
WebView wv = (WebView)findViewById(R.id.webview);
wv.setWebViewClient(new WebViewClient(){
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
wv.loadUrl("your url here");
+0
什么是'shouldOverrideUrlLoading'方法用于? – winklerrr 2017-05-14 15:31:31
相关问题
- 1. 阅读内容(XML)于Android的WebView
- 2. 如何在Android xml中使用webview?
- 3. Android WebView视口
- 4. Android - webview中断
- 5. Android WebView错误
- 6. Android webview
- 7. Android WebView
- 8. android webview
- 9. WebView太长。 Android
- 10. android中的webview
- 11. Android WebView Onclick ProgressBar
- 12. Android将WebView复制到Webview
- 13. Android WebView geolocation
- 14. Android - WebView的问题
- 15. 我的webview的android
- 16. android,webview,javascript注入
- 17. Android的webview内容超过了webview
- 18. Android WebView导致NullPointer
- 19. Android 3.0 WebView崩溃
- 20. Android WebView和WebGL
- 21. Android WebView CSS float
- 22. Android Webview函数
- 23. Android Working WebView 2016
- 24. Android WebView NullPointerException?
- 25. Android WebView onReceivedError()
- 26. Android webview position:fixed
- 27. SignalR和Android Webview
- 28. Android webview与webGL
- 29. python android webview sl4a
- 30. android webview include javascript
大,我可以通过XML设定的网址吗? – panthro 2012-08-02 14:33:45
我不相信你可以。这是另一个类似问题的帖子。 http://stackoverflow.com/questions/5219794/how-to-set-url-on-webview-from-a-xml-layout-file-on-android – prolink007 2012-08-02 14:36:56