Tôi đang làm việc trên chế độ xem có chứa chế độ xem web, hoạt động hoàn hảo trên 2.3, 4.1, nhưng khi tôi thử trên trình mô phỏng 4.4, nó hiển thịXem quá lớn để vừa với bản vẽ bộ nhớ cache trên Webview bên trong scrollview
View too large to fit into drawing cache, needs 5744640 bytes, only 3932160 available
Chế độ xem web chỉ để trống.
Và đó là cách bố trí
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp" >
<TextView
android:id="@+id/newsTitle"
android:textSize="18sp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/last_update" />
<WebView
android:id="@+id/newsContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/last_update" />
<TextView
android:id="@+id/newsDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/last_update" />
</LinearLayout>
</ScrollView>
</LinearLayout>
Tôi cố gắng để sử dụng mywebView.setDrawingCacheEnabled(false);
nhưng nó chỉ trả lại cảnh báo tương tự.
Ngoài ra, tôi thấy vấn đề xảy ra khi trang web có kích thước trên màn hình, nhưng khi tôi hiển thị, tôi thấy bố cục của web hơi khác, trên 2,3, 4,1, nó có thể đơn giản bắt đầu dòng mới nếu từ đó là vượt quá trang, tuy nhiên, trong 4.4 nó không, vì vậy một phần của từ là ra khỏi màn hình.
Cách khắc phục? Cảm ơn
Cuối cùng tôi từ bỏ, vì nó là lỗi trong android, chỉ cần đảm nền của tôi trắng và nền webview trắng, mọi thứ hoàn hảo sau đó – user782104
Hãy thử largeHeap = "true" trong thẻ của bạn trong manifest. Nó cho phép ứng dụng của bạn sử dụng phần lớn hơn một chút so với thông thường (Vì vậy kích thước bộ nhớ cache có thể tăng lên). Nó có thể giúp bạn. Chỉ cần thử và cho tôi biết. –
Sripathi
Cảm ơn sự giúp đỡ của bạn, vẫn còn lỗi tương tự – user782104