的WebView和GridView成滚动型,查看过大,以适应绘图缓存 [英] WebView and GridView into ScrollView, View too large to fit into drawing cache
本文介绍了的WebView和GridView成滚动型,查看过大,以适应绘图缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个布局内存问题。当我有一个大的WebView它不显示任何东西和logcat的显示查看过大,以适应绘图缓存。
的布局是:
<滚动型
机器人:ID =@ + ID / scrollNoticia
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:背景=@绘制/ ficha_curva
机器人:layout_below =@ + ID / LINEA
机器人:滚动条=无
> < RelativeLayout的
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
机器人:paddingBottom会=12dp > <的WebView
机器人:ID =@ + ID / webViewNoticia
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
机器人:滚动条=无 /> < GridView控件
机器人:ID =@ + ID / gridGaleria
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
机器人:layout_below =@ ID / webViewNoticia
机器人:horizontalSpacing =4DP
机器人:verticalSpacing =4DP
机器人:为numColumns =4>
< / GridView的>
< / RelativeLayout的>
< /滚动型>
解决方案
尝试禁用硬件加速:的 http://developer.android.com/guide/topics/graphics/hardware-accel.html
请参阅WebView在滚动型:"查看过大,以适应绘图缓存" - ?如何返工布局获取更多的信息。
I have a layout memory issue. When I have a large webview it doesn't shows anything and the logcat shows "View too large to fit into drawing cache".
The layout is:
<ScrollView
android:id="@+id/scrollNoticia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ficha_curva"
android:layout_below="@+id/linea"
android:scrollbars="none"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="12dp"
>
<WebView
android:id="@+id/webViewNoticia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
/>
<GridView
android:id="@+id/gridGaleria"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/webViewNoticia"
android:horizontalSpacing="4dp"
android:verticalSpacing="4dp"
android:numColumns="4" >
</GridView>
</RelativeLayout>
</ScrollView>
解决方案
Try disabling the hardware acceleration : http://developer.android.com/guide/topics/graphics/hardware-accel.html
See WebView in ScrollView: "View too large to fit into drawing cache" - how to rework layout? for more informations.
这篇关于的WebView和GridView成滚动型,查看过大,以适应绘图缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文