1

MyBringBackSurface という名前の SurfaceView があり、コンストラクターは次のとおりです。

public MyBringBackSurface(Context context) {
        // TODO Auto-generated constructor stub
        super(context);
        setBackgroundResource(R.drawable.background);
    }

背景が表示されますが、その前に他のビットマップが表示されるように透明にする方法は?

4

1 に答える 1

0

SurfaceView の背景色として Color.TRANSPARENT を使用します。

表面ビューにビットマップを表示したい場合は、以下のxmlのようなものを試すことができます

<RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center">
    <SurfaceView
        android:id="@+id/cameraSurface"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

     <ImageView
               android:id="@+id/IV_MASK"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:src="@drawable/mask"
                android:background="@android:color/transparent"
               />
     </RelativeLayout>
于 2013-07-05T20:50:47.570 に答える