如何使表面视图透明你好,我只想让我的DrawinSurface视图透明。我试了很多次,但都没用。下面是我的xml代码,以使我的表面视图透明<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/icon" >
</ImageView>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00000000" >
<codewalla.android.drawings.DrawingSurface
android:id="@+id/drawingSurface"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</codewalla.android.drawings.DrawingSurface>
</LinearLayout>
</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/colorRedBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="R" />
<Button
android:id="@+id/colorBlueBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="G" />
</LinearLayout></RelativeLayout>
3 回答
郎朗坤
TA贡献1921条经验 获得超9个赞
SurfaceView sfvTrack = (SurfaceView)findViewById(R.id.sfvTrack);sfvTrack.setZOrderOnTop(true); // necessarySurfaceHolder sfhTrackHolder = sfvTrack.getHolder();sfhTrackHolder.setFormat(PixelFormat.TRANSPARENT);
幕布斯6054654
TA贡献1876条经验 获得超7个赞
sfvTrack.setZOrderOnTop(true);
setZOrderMediaOverlay(true);
- 3 回答
- 0 关注
- 420 浏览
添加回答
举报
0/150
提交
取消