How can I place a SurfaceView inside one or more scrollviews ?
- by Mervin
Hello,
I'm making a 2D game for Android and I've encountered the following problem:
- I have made a class that extends SurfaceView and draws my graphics (the size of the canvas that I use has to be 1664x864).
This is ofcourse too big for the screen so I needed scrolling,
I chose to use google's ScrollView and HorizontalScrollView (nested) for this,
But whenever I add my SurfaceView to a ScrollView (whether it's 1 or 2) via AddChild it only draws the ScrollView , SurfaceCreated() isn't even called on the SurfaceView.
(Drawing the SurfaceView in a layout without adding it to a ScrollView does work.)
I realize that there are other options for scrolling like a screen-sized canvas and bitmap offsets but this would really be my preferred way to go.
I would really appreciate some help to make this work.