Custom View inside ScrollView


Last Updated:

  1. jshailes

    jshailes New Member This Topic's Starter

    Joined:
    Mar 2, 2010
    Messages:
    4
    Likes Received:
    0
    Hello. I'm having some problems making progress as my onDraw Event doesn't get called. I've read about setContentView but I can't call this as I'd like it inside a ScrollView. In order to accomplish this i've just the following layout:

    Code (Text):
    1.  
    2. <ScrollView android:id="@+id/ScrollView02"
    3.     android:layout_width="wrap_content"
    4.     android:layout_height="wrap_content"
    5.     xmlns:android="http://schemas.android.com/apk/res/android"
    6.     android:background="@color/background1">
    7.  
    8.         <co.uk.act.android.view.UviMapView android:id="@+id/map1"
    9.             xmlns:android="http://schemas.android.com/apk/res/android"
    10.             android:layout_height="wrap_content"
    11.             android:layout_width="fill_parent"
    12.             android:background="@color/background2" />
    13. </ScrollView>
    14.  
    I hoped to see the background change color (background1=red, background2=blue) but it stays black. Can anyone offer any guidance on this?
     

    Advertisement
  2. zebdor

    zebdor Member

    Joined:
    Mar 31, 2010
    Messages:
    17
    Likes Received:
    0
    Hey,

    I was also having trouble with this. Try setting layout_width and layout_height to an actual pixel amount instead of fill_parent or wrap_content. This solved the problem for me.
     

Share This Page

Loading...