控件美化
来源:互联网 发布:知乎话题精华 mobi 编辑:程序博客网 时间:2024/05/16 11:47
具体代码如下:
main.xml:
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
- <Button
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="10dp"
- android:text="button1"
- android:background="@drawable/button_selector"
- />
- <Button
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="10dp"
- android:text="button2"
- android:background="@drawable/button_selector"
- />
- <Button
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="10dp"
- android:text="button3"
- android:background="@drawable/button_selector"
- />
- </LinearLayout>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/bg2"
- android:focusable="false"
- />
- </RelativeLayout>
button_selector.xml:
- <?xml version="1.0" encoding="utf-8"?>
- <selector
- xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" >
- <shape>
- <!-- 实心,即填充 -->
- <solid android:color="#8470FF"/>
- <!-- 描边 -->
- <stroke
- android:width="2dp"
- android:color="#FFFF00"/>
- <!-- 圆角 -->
- <corners
- android:radius="5dp" />
- <padding
- android:left="10dp"
- android:top="10dp"
- android:right="10dp"
- android:bottom="10dp" />
- </shape>
- </item>
- <item>
- <shape>
- <!-- 实心,即填充 -->
- <solid android:color="#8470FF"/>
- <corners
- android:radius="5dp" />
- <padding
- android:left="10dp"
- android:top="10dp"
- android:right="10dp"
- android:bottom="10dp" />
- </shape>
- </item>
- </selector>
- 控件美化
- 控件美化
- 美化文件上传控件
- 美化文件上传控件
- 美化上传控件二
- WinForm-ListBox控件美化
- Qt控件美化
- android的控件美化
- WinForm-ListBox控件美化
- Qt控件美化
- 美化DataGridView控件
- 上传控件美化
- dotnetbar winform 美化控件
- 美化EditText控件
- Qt控件美化
- 美化DataGridView控件
- Qt控件美化
- shape+selector美化控件
- Centos下的Apache大小写敏感问题 (食用菌百科网-junbaike.com站长提供)
- poj 3259 Wormholes (SPFA 判断有无负权回路)
- hadoop是什么?hdoop能作什么?
- 一次性把变更控制系统、配置管理系统说清楚(主要项目管理工具)
- java应用程序结构即运行机制
- 控件美化
- QT的FindDialog
- 直接拿来用!最火的Android开源项目(一)
- MyEclipse设置JDK编译版本
- 致生活中那些疲惫的人
- Intent---Android中的Intent详细讲解
- rest web service - jersey . spring3
- android编程需注意!(第一话)new fragment的悲剧
- mysql 添加列,修改列,删除列