Android 将Button设置为圆角
来源:互联网 发布:杜汶泽现状2017 知乎 编辑:程序博客网 时间:2024/05/21 09:34
文件夹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="#FFFFFF" /> <!-- 设置按钮的四个角为弧形 --> <!-- android:radius 弧形的半径 --> <corners android:radius="5dip" /> <!-- padding:Button里面的文字与Button边界的间隔 --> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape>
在定义button的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>
转载自:http://liangruijun.blog.51cto.com/3061169/630051
- Android 将Button设置为圆角
- 设置android中的Button为半透明
- Android中设置Button为透明
- android 设置Button为圆形按钮
- Android 设置Button为透明色
- Android中设置圆角button
- 如何将dialog中的button动态设置为disable
- button 圆角设置
- 为Button设置选择器
- 将对话框设置为圆角
- iOS将UIImage设置为圆角
- android设置背景色为透明,Button控件透明
- android radiobutton 设置文本为空 button属性居中效果
- 用自定义.9图设置为android button的背景
- android 客户端学习-给button按钮设置圆角
- 将Android Activity背景设置为墙纸
- Android 将程序设置为app2sd
- 将android界面背景设置为黑色
- Android中在控件上显示倒计时
- IIS发布网站以及引用office组件不能远程访问问题
- ganglia与Ubuntu安装与配置
- 归并排序
- shell 中的循环
- Android 将Button设置为圆角
- 程序员技术练级攻略
- 阿里巴巴2014校园招聘笔试题(成都站,软件研发岗)——2014.09.22
- scanf使用细节
- mutex 与 WaitForSingleObject
- 化简叠词
- C++友元函数的介绍
- new 对象详细过程
- C程序设计语言--缓冲、常见的问题和全局变量