Android如何设置圆角按钮
来源:互联网 发布:菊水 清酒 知乎 编辑:程序博客网 时间:2024/06/05 05:57
1. 在res目录下的drawable目录下新建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="#FF065E8D" /> <!-- 设置按钮的四个角为弧形 --> <!-- android:radius 弧形的半径 --> <corners android:radius="15dip" /> <!-- padding:Button里面的文字与Button边界的间隔 --> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /></shape>
2.在布局文件中调用。
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/roundButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/shape" android:text="圆角按钮" /></LinearLayout>
2 0
- Android如何设置圆角按钮
- Android如何设置圆角按钮 类似微信的登陆按钮
- android设置圆角按钮ButtonM
- 【android】:安卓如何设置图片按钮
- 由如何设置圆角按钮引发的思考
- 如何设置默认按钮
- 如何设置按钮背景图片
- 如何设置按钮背景图片
- android基础6——设置圆角按钮
- android 客户端学习-给button按钮设置圆角
- 1. android 设置圆角按钮后,按下按钮后,还能改变按钮的颜色
- Android 设置透明按钮
- storyboard设置圆角按钮
- 如何设置按钮背景透明度
- 如何多线程设置按钮倒计时
- android圆角按钮
- android 圆角按钮
- Android 圆角按钮
- HDU-4552-怪盗基德的挑战书
- ARM寄存器介绍
- zoj 1060 Sorting It All Out(拓扑排序)
- leetCode 82.Remove Duplicates from Sorted List II (删除排序链表的重复II) 解题思路和方法
- Dynamics CRM2015 非基础语言环境下产品无法新建的问题
- Android如何设置圆角按钮
- android <viewStub />, <requestFocus />, <merge /> and <include />用法
- Codeforces Round #279 (Div. 2) B. Queue 模拟
- 初学者很实用:纯struts框架实现用户登陆
- android代码创建布局
- HTMLParser 学习篇上
- OC类之 Dictionary
- 自定义Dialog
- ADB端口被占用,adb server is out of date