实现一个ImageView的一个SurfaceView [英] Implement a ImageView to a SurfaceView
本文介绍了实现一个ImageView的一个SurfaceView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个小问题...
I have one small question...
是否有可能实施的ImageView
在 SurfaceView
,
或者创建一个的ImageView
中的 SurfaceView
Is it possible to implement a ImageView
inside a SurfaceView
,
or to create a ImageView
inside the SurfaceView
如果是的话可能有人点我就如何做正确的方向。
And if so could someone point me in the right direction on how to do it.
推荐答案
我这样做是在code。与一个TextView,但你可以只改变与ImageView的文本视图。
I did this in code with a TextView, but you could just change text view with ImageView.
我的TextView是在顶部一个小酒吧,因此更改参数。
My TextView is a small bar across the top, hence the changing parameters.
params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
TextView tv = new TextView(this);
ourSurfaceView = new SurfGame(this);
testbox = new LinearLayout.LayoutParams(widthx,heighty/30);
layout.addView(tv,testbox);
layout.addView(ourSurfaceView,params);
setContentView(layout);
这篇关于实现一个ImageView的一个SurfaceView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文