1. Check out our app, Forums for Android! Download and leave feedback here!

Custom View inside ScrollView

Discussion in 'Application Development' started by jshailes, Mar 2, 2010.

  1. jshailes

    jshailes New Member
    Thread Starter
    5

    Mar 2, 2010
    4
    0
    5
    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
    35

    Mar 31, 2010
    17
    0
    35
    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...