如何使表面視圖透明你好,我只想讓我的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 關注
- 450 瀏覽
添加回答
舉報
0/150
提交
取消