1
所以,我有一個簡單的應用程序,在web視圖中加載圖像板。除ICS之外,所有的Android版本都很棒。首先,呈現的頁面不再填充父頁,而是填充大約80%的視口。其次,來自頁面上的帖子的圖像和文本被包裹成填充視口寬度的大約45%的窄列。ICS渲染寬度較窄的webview
我意識到這可能是一個問題,4.0+是如何閱讀這個wakaba圖像板(xhtml)的元素,但我已經打到了牆上看着。也許有人可以解釋什麼改變了ICS webviews來幫助我隔離問題?這是webkit的問題嗎?
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
源:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
wv = new WebView(this);
WebSettings webSettings = wv.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setMinimumFontSize(48);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
wv.loadUrl("http://example.com");
wv.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
wv.setScrollbarFadingEnabled(true);
}
HTML帖子的例子被壓扁:
<span class="filesize">File: <a target="_blank" href="/b-/src/1329696064044.png">1329696064044.png</a> -(<em>1063442 B, 1433x1080</em>)</span> <span class="thumbnailmsg">Thumbnail displayed, click image for full size.</span><br />
<a target="_blank" href="/b-/src/1329696064044.png"> <img src="/b-/thumb/1329696064044s.jpg" width="500" height="376" alt="1063442" class="thumb" /></a> <a name="2058"></a>
<label><input type="checkbox" name="delete" value="2058" /> <span class="filetitle"></span> <span class="postername">Anonymous</span> 02/19 17:01</label> <span class="reflink">
<a href="/b-/res/2058.html#i2058">No.2058</a> </span> [<a href="/b-/res/2058.html">Reply</a>] <blockquote> <p>I'm not saying he's real, but he's real.<br />
<a href="http://www.youtube.com/watch?v=rkJZYxWAhUA&feature=related" rel="nofollow">http://www.youtube.com/watch?v=rkJZYxWAhUA&feature=related</a></p> </blockquote> <br clear="left" /><hr />
先發制人的感謝!