SurfaceView
probably does not work like a regular View
in this regard.
Instead, do the following:
- Put your
SurfaceView
inside of a
FrameLayout
orRelativeLayout
in
your layout XML file, since both of
those allow stacking of widgets on
the Z-axis - Move your drawing logic
into a separate customView
class - Add an instance of the custom View
class to the layout XML file as a
child of theFrameLayout
or
RelativeLayout
, but have it appear
after theSurfaceView
This will cause your custom View
class to appear to float above the SurfaceView
.