How can I place a SurfaceView inside one or more scrollviews ?
Posted
by Mervin
on Stack Overflow
See other posts from Stack Overflow
or by Mervin
Published on 2010-06-12T10:16:27Z
Indexed on
2010/06/12
10:23 UTC
Read the original article
Hit count: 905
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.
© Stack Overflow or respective owner