亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使表面視圖透明

如何使表面視圖透明

白衣非少年 2019-07-17 10:30:31
如何使表面視圖透明你好,我只想讓我的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);


查看完整回答
反對 回復 2019-07-17
?
幕布斯6054654

TA貢獻1876條經驗 獲得超7個贊

sfvTrack.setZOrderOnTop(true);

將表面視圖放置在窗口的頂部,這意味著您不能在表面視圖之上添加項。

如果要在表面視圖的頂部添加視圖,則應考慮使用:

setZOrderMediaOverlay(true);

相反。這將該表面視圖放置在其他表面視圖的頂部,但仍然在窗口后面,允許您在表面視圖的頂部添加其他可見視圖。


查看完整回答
反對 回復 2019-07-17
  • 3 回答
  • 0 關注
  • 450 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號