• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Custom View inside ScrollView

jshailes

Lurker
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:
<ScrollView android:id="@+id/ScrollView02"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/background1">

        <co.uk.act.android.view.UviMapView android:id="@+id/map1"
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:background="@color/background2" />
</ScrollView>

I hoped to see the background change color (background1=red, background2=blue) but it stays black. Can anyone offer any guidance on this?
 
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.
 
Back
Top Bottom