解决方法
你的问题已经有了答案:
引自帖子:
SurfaceView
probably does not work like a regularView
in this
regard.Instead,do the following:
@H_502_23@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 @H_502_23@Move your drawing logic
into a separate customView
class @H_502_23@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
.
还有一个示例项目可满足您的需求