6

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>
jihonrado
  • 409
  • 2
  • 11
Pablo Martinez
  • 1,573
  • 12
  • 31
  • Did u get any solution for this?? – Swati Sachdeva Oct 25 '13 at 05:50
  • Yes I got a solution which is more of a workaround, i calculate the webview height and if it is greater than a particular height i just change the height of webview to that particular height. I am using this in my current app and it works fine – Swati Sachdeva Feb 25 '14 at 05:44

2 Answers2

0

Neither WebView or GridView need to be embedded in a scrollview. The WebView can scroll by itself when the content size over the screen size, and the GridView too. In the normal way, the GridView just create so many child views as are visible. Once a view goes out of screen, it will be reused. So if you embed a GridView in a ScrollView, maybe you will wrong the reuse pattern.

TaoZang
  • 1,690
  • 2
  • 15
  • 15
0

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.

Community
  • 1
  • 1
PatrickNLT
  • 4,075
  • 1
  • 25
  • 32