导航:首页 > 操作系统 > android镂空

android镂空

发布时间:2023-07-14 21:47:48

1. android 镂空遮罩怎么用

看到一本电子杂志上有遮罩层的效果,感觉很漂亮,以为很麻烦,搜索了很多关于android遮罩层的,也没有得出一点思路,原来就是一个透明的效果,然后上面弹出的控件是透明或者半透明之类的,可以选择颜色,还是#ARBG,其中A就是传说中的透明色的值(可以根据需要设置透明的效果),废话不多说了,发一个简单的Demo吧,是我山寨的那本杂志的效果:(由于杂志内容主要是图片,弹出层才是给出的文字信息,所以我猜测是用Gallery显示的杂志内容)
xml布局文件:

[c-sharp] view plainprint?
01.<?xml version="1.0" encoding="utf-8"?>
02.<FrameLayout xmlns:android="http://schemas.android.com/apk/res/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.</FrameL<textarea name="code" class="xhtml" cols="50" rows="15"><?xml version="1.0" encoding="utf-8"?>
36.<FrameLayout xmlns:android="http://schemas.android.com/apk/res/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="http://schemas.android.com/apk/res/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>
</FrameL<textarea name="code" class="xhtml" cols="50" rows="15"><?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/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>

阅读全文

与android镂空相关的资料

热点内容
云服务器显示360登陆 浏览:849
批量生产日期的文件夹 浏览:278
stl通用算法 浏览:908
建筑资料软件加密狗如何复制 浏览:345
华为手机怎么换文件夹的图标 浏览:845
pdf转换png格式的图片 浏览:518
桌面新文件夹打不开 浏览:479
生存边缘建造是哪个文件夹 浏览:530
仙岛湖王英码头到东源码头 浏览:975
nfc对加密锁毫无反应吗 浏览:222
android文件分区 浏览:368
南京开通数控螺纹编程 浏览:290
服务器与ups用什么线 浏览:967
unix网络命令 浏览:48
程序员表白代码大全可复制 浏览:365
手机如何共享web服务器 浏览:956
php接口有什么用 浏览:382
iis如何安装php 浏览:791
k5嗜血魔键安卓怎么调好用 浏览:834
建行app中如何添加银行卡 浏览:281