我在ListView中添加了一个headerview,它有一个WebView。
代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
`enter code here`android:layout_width="match_parent"
*emphasized text*android:layout_height="match_parent"
android:orientation="vertical">
<WebView
android:id="@+id/wv_show"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layerType="software"
android:scrollbars="none" />
</LinearLayout>
View headerView = LayoutInflater.from(this).inflate(R.layout.view_webview, null);
webView = (WebView) headerView.findViewById(R.id.wv_show);
listview.addHeaderView(headerView);
listview.setAdapter(adapter);
webView.loadUrl("http://mp.weixin.qq.com/s?__biz=MzIwNzA0MDYwMQ==&mid=503270115&idx=1&sn=74cf175e5261d7e586b7290122b7277f#rd");
问题是,如何在WebView中显示图像?
答案 0 :(得分:0)
尝试将此行webView.loadUrl("http://mp.weixin.qq.com/s?__biz=MzIwNzA0MDYwMQ==&mid=503270115&idx=1&sn=74cf175e5261d7e586b7290122b7277f#rd");
移至此listview.addHeaderView(headerView);