导航:首页 > 操作系统 > 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镂空相关的资料

热点内容
php读取word乱码 浏览:753
minicom源码 浏览:1000
海尔冷柜压缩机 浏览:415
联通服务器如何调试信号 浏览:135
stata新命令 浏览:940
单调栈算法python 浏览:605
微信解压游戏怎么下载 浏览:961
忍三服务器不同如何登上账号 浏览:821
php求积 浏览:294
封面命令 浏览:879
手机复制文件夹到另一个文件夹 浏览:992
手游为什么不能统一下服务器 浏览:246
iphone上pdf 浏览:884
window定时python脚本 浏览:64
怎么运行cmd命令行 浏览:366
php中类的继承 浏览:228
openvpnlinux安装配置 浏览:463
PHP7从入门到精通 浏览:27
单片机生日 浏览:500
linux当前进程号 浏览:728