加一個全屏的view吧,backgroundcolor設(shè)置成你想要的透明度

站在用戶的角度思考問題,與客戶深入溝通,找到博樂網(wǎng)站設(shè)計與博樂網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設(shè)計制作、網(wǎng)站設(shè)計、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、國際域名空間、虛擬主機、企業(yè)郵箱。業(yè)務(wù)覆蓋博樂地區(qū)。
加載完成remove或者setvisibility為gone
祝你早日完成
操作是在圖層上,圖層與圖層之間,按住ctr鍵,會發(fā)現(xiàn)鼠標(biāo)小手變成了一個由兩個小圓一個前頭組成的鼠標(biāo)。然后點擊一下,(一定要在兩個圖層之間),然后,就發(fā)現(xiàn)上面的圖層就在下面圖層的遮罩范圍內(nèi)了。或者選中上面一個圖層,使用快捷鍵ctrl+alt...
看到一本電子雜志上有遮罩層的效果,感覺很漂亮,以為很麻煩,搜索了很多關(guān)于android遮罩層的,也沒有得出一點思路,原來就是一個透明的效果,然后上面彈出的控件是透明或者半透明之類的,可以選擇顏色,還是#ARBG,其中A就是傳說中的透明色的值(可以根據(jù)需要設(shè)置透明的效果),廢話不多說了,發(fā)一個簡單的Demo吧,是我山寨的那本雜志的效果:(由于雜志內(nèi)容主要是圖片,彈出層才是給出的文字信息,所以我猜測是用Gallery顯示的雜志內(nèi)容)
xml布局文件:
[c-sharp] view plaincopyprint?
01.?xml version="1.0" encoding="utf-8"?
02.FrameLayout xmlns:android=""
03. android:id="@+id/layout"
04. android:layout_width="fill_parent"
05. android:layout_height="fill_parent"
06.
07. Gallery
08. android:id="@+id/showGallery"
09. android:layout_width="fill_parent"
10. android:layout_height="fill_parent"
11. android:spacing="0dip"
12. /
13. RelativeLayout
14. android:orientation="horizontal"
15. android:layout_width="fill_parent"
16. android:layout_height="wrap_content"
17. android:layout_gravity="bottom"
18. android:background="#86222222"
19.
20. TextView
21. android:id="@+id/titleTextView"
22. android:layout_width="wrap_content"
23. android:layout_height="wrap_content"
24. android:layout_toRightOf="@id/secondKillButton"
25. android:textColor="#ff0000"
26. /
27. Button
28. android:id="@+id/unfoldButton"
29. android:layout_width="wrap_content"
30. android:layout_height="wrap_content"
31. android:layout_alignParentRight="true"
32. android:text="展開"
33. /
34. /RelativeLayout
35./FrameLtextarea name="code" class="xhtml" cols="50" rows="15"?xml version="1.0" encoding="utf-8"?
36.FrameLayout xmlns:android=""
37. android:id="@+id/layout"
38. android:layout_width="fill_parent"
39. android:layout_height="fill_parent"
40.
41. Gallery
42. android:id="@+id/showGallery"
43. android:layout_width="fill_parent"
44. android:layout_height="fill_parent"
45. android:spacing="0dip"
46. /
47. RelativeLayout
48. android:orientation="horizontal"
49. android:layout_width="fill_parent"
50. android:layout_height="wrap_content"
51. android:layout_gravity="bottom"
52. android:background="#86222222"
53.
54. TextView
55. android:id="@+id/titleTextView"
56. android:layout_width="wrap_content"
57. android:layout_height="wrap_content"
58. android:layout_toRightOf="@id/secondKillButton"
59. android:textColor="#ff0000"
60. /
61. Button
62. android:id="@+id/unfoldButton"
63. android:layout_width="wrap_content"
64. android:layout_height="wrap_content"
65. android:layout_alignParentRight="true"
66. android:text="展開"
67. /
68. /RelativeLayout
69./FrameLayout
?xml version="1.0" encoding="utf-8"?
FrameLayout xmlns:android=""
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
Gallery
android:id="@+id/showGallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:spacing="0dip"
/
RelativeLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#86222222"
TextView
android:id="@+id/titleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/secondKillButton"
android:textColor="#ff0000"
/
Button
android:id="@+id/unfoldButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="展開"
/
/RelativeLayout
/FrameLtextarea name="code" class="xhtml" cols="50" rows="15"?xml version="1.0" encoding="utf-8"?
FrameLayout xmlns:android=""
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
Gallery
android:id="@+id/showGallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:spacing="0dip"
/
RelativeLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#86222222"
TextView
android:id="@+id/titleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/secondKillButton"
android:textColor="#ff0000"
/
Button
android:id="@+id/unfoldButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="展開"
/
/RelativeLayout
/FrameLayout
設(shè)置popupwindow的高度是 wrap_parent
重寫 showAsDropDown 方法,設(shè)置window的背景透明度
重寫 dismiss 方法,恢復(fù)window的背景透明度
注意 super方法要在 改變透明度的后面
否則會把你的壁紙給 閃出來
android中的ImageView只能顯示矩形的圖片,這樣一來不能滿足我們其他的需求,比如要顯示圓形的圖片,這個時候,我們就需要自定義ImageView了,其原理就是首先獲取到圖片的Bitmap,然后進行裁剪圓形的bitmap,然后在onDraw()進行繪制圓形圖片輸出。
標(biāo)題名稱:android遮罩,Android遮罩模糊
URL標(biāo)題:http://chinadenli.net/article27/dsispjj.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計、網(wǎng)站營銷、服務(wù)器托管、App開發(fā)、移動網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)