android圆角按钮的实现
来源:互联网 发布:java 存储过程 编辑:程序博客网 时间:2024/05/30 02:22
1在res目录下的drawable-mdpi建立xml文件shape.xml
<?xml version="1.0" encoding="UTF-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!-- 填充的颜色 --> <solid android:color="#FFFFFF" /> <!-- 设置按钮的四个角为弧形 --> <!-- android:radius 弧形的半径 --> <corners android:radius="5dip" /><!-- padding:Button里面的文字与Button边界的间隔 --><padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp"/></shape>
3使用时,在用到的地方的xml文件里这么写
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /><Button android:id="@+id/roundButton" android:text=" 圆角按钮 " android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/shape" /></LinearLayout>
0 0
- android实现的圆角按钮Button
- android圆角按钮的实现
- Android 实现圆角按钮
- Android开发--圆角按钮和绘制直线的实现
- Android开发——半边圆角按钮的实现
- Android旋转按钮的实现
- android按钮动画的实现
- Android 返回按钮的实现
- Android实现倒计时的按钮
- Android实现倒计时的按钮
- Android 倒计时按钮的实现
- Android的圆角按钮和按钮颜色
- HTML--圆角按钮的实现
- Android 实现圆角按钮(selector和shape的简单用法)
- Android 实现圆角按钮(selector和shape的简单用法)
- android圆角按钮的背景
- android圆角按钮
- android 圆角按钮
- 根据Unicode编码完美的判断中文汉字和符号
- Servlet入门
- 对于二级指针的认识
- 算法分析:大O符号/大Ω符号/大Θ符号/小o符号/小w符号
- ubuntu添加开机启动脚本(服务,app)
- android圆角按钮的实现
- Java中的HashMap和HashSet
- Android冷启动白屏解析,带你一步步分析和解决问题
- HDU-4571 Travel in time (Floyd&&(DFS||DP))
- 提交您的博客到各大网站
- hdoj 2041 递推,递归会超时
- 检查字符串中的结束标记
- windows启动过程
- POJ 2828 Buy Tickets 又是线段树!