在drawable文件夹下新建btn_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"/>
<corners
android:topLeftRadius="8dip"
android:topRightRadius="8dip
android:bottomLeftRadius="8dip"
android:bottomRightRadius="8dip"/>
</shape>

先解释一下上面的代码:

1.shape用于定义形状,有四种形状(矩形rectangle| 椭圆oval | 直线line | 圆形ring)。

2.solid用于设置填充形状的颜色。

3.corners用于创建圆角(只用于形状是矩形)。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC+CAIAAADiP+mOAAAKz0lEQVR4nO2dMW/bOBTH+7F0l8t26F3XQ2bh9nP2jlryATJ1qgdNRdC1uDlaOhTx3tuMAPkAngRIlG6QLZESKfHZfKQk/3/I0sgmKerHR/LZbN7VANiR5/nr6+u70M0AiwHGABowBtCAMYAGjAE0YAygAWMADRgDaMAYQAPGABowBtCAMYAGjAE0YAygAWMADRgDaMAYQAPGABowZh1kZRSV6d5DTTDmEpw8p6yMokL5SUTvapJd0JLepfHqpoExl+DMGKmQvYjlp8hijLm6aWDMJXAYU9f7lF7s2caQq4Mx51PqYnuVxu0vh8+puxqnlXqpK1d5hIOrWdKVH8dFFIt9+7JMxL2qs0Ejp6sbn7BgzCX0e79K20eofxKnf+5F3M41eifKTFeFcqmZUDpjuktZ0jVjMsao1QlpAhSJRhoYcwkTD6NK41OPa5+THB7UlWm3cJGvyp5NF2KIUuPV9e5PNu8IjLkEtfeboCJ3vvGJyi/uTQS9JyS9kVD+hDHm6upanVhhjFuGU4bav6oWI8bITqgjnsWY8eq6u0CMcc2FMUZ3qVlVmB+wS2OG1fUUgTGuOX8dM3JJJJFh5UtbDNmtY9TqlmJM0+ii1x0O0d25E0Qi75On9kpt/B/fPytZNeWqsnlp5pRpY3qNHK1Os78bM4YnHzWFNNqGb780pX0qRhmLFilUQtGl2rCxfEw8lqpRSu1s0IeEY41WMabXyPHq5HxPLNKJ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LbG9kIsYsazJqoRszHB+WA/rsN9oY019VtFOqdcnNU1QCTOPTqc1t+y83pifiovZWJGNI/TX4p9cYY7qR6dWoUXGnxrTtFrE+ts0WW2PMa45ZrmOMv59oUpMdlhbgOmNsF3l2uQaj6zMlz/MvX76Y9kqnNbyapTBveeRNiuaf526ybIxRC6/rKk20T1dt0rA0KYmn2c1JezE1j6yVSarruM9vLlVp3CqipqQXQJ7n379/N8SYJCmVNUGHIa1SS2vJLnhY52NsjbFJ9pwWB0Mn5Cbp/GsWNI0B3fIoFqkSctrPqoooEaPT62nJPFgzmZfbcybP89fXV3x2DWyBMYAGjAE0YAygAWMADRgDaMAYQAPGABowBtCAMYDGbI0xfn60CrzfnbvvcK3MGLuPiy9umPnAyui3+IztHLk0Xp19q52ddoAxFzasd2CFxRhzdfathjFW7/JgzHkHVs42Jvz5mLkbs4DjL2Nf9FG+TlrGsfqliGxQfu8W5ng+ZtbGLOP4i3pgRfM10OMl+Quaw+raADAVY0Kfj5m1MRbfjKzrwF8b7S0L5KuWh1SmyzdX1+szH+djlmPMnI6/mA+sGIepdXXje6Xw52MWaMx8jr8YDqw4N2a8Os/nY5ZlzPyOv/QOrLAaM6wuxPmYxRgz2+MvyoGV0Ve6WMeEPx8za2MWcvxFzqpl/caot2AT0mZ+PmbWxsz2+Et/IHY26EOCzSEV3Wp3judjZmvMGsmSZR1m0wJjOMmS6VXC0oAxnKh5+hXoUsMYQKUx5n/YTve85bzUqgAAAABJRU5ErkJggg==" alt="" />

topLeftRadius、topRightRadius、bottomLeftRadius、bottomRightRadius分别设置左上,右上,左下,右下圆角的半径。

使用方法:

android:background="@drawable/btn_shape"

   <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button"
android:background="@drawable/btn_shape"
/>

效果图:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW4AAAIgCAIAAAAqehRZAAAgAElEQVR4nO3dd1zVhf7HcQ4grvsrjR6P6pql5bVQMA0UEFAUxJULM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UXh125GXLsVlX7rcnrx5fTiy+m37nUz6lpRRFpheGrhpZSCEHX+WVXeaWXuicTcoITcgPhc/7jcw3G5fnG5vnG5vnF5PvXuUO2u5h26mnvoau7B+/KOvb/r3jHXD/yunAPROQeicw5cyTpwOd07Ms07PPngJdXBkPhD52N8gqN8Tof7nLrkczLU50SIz/ELPsfO+xw77xN03ifonE/QOZ+gs9oOBQYfCjxzMPCM99Ez3keDDxwNPhBwdn/g+X3HLu47Eb7vVNTeMzF7z8Z5XVB6hao9L6V6hqV5hqd7RGR4RGZ6RGR6RGR6RP6+iIfl/r/LqNF9357lEZnlqS0qyysqyysqe+9lbTn1ad8f2d6onL1R2XujsvdGZntFZntGZntGZHtEZHtEZLmHZ+0Jz9oTnrVbW1g9upRZz3bdq/7fUquM3ZcydmkL1Za+82L6zovpO0PSd4Zc+/V3pf164bf+H8Q/euU0a9XfAAAAAElFTkSuQmCC" alt="" />

 参考网址:
http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

Android学习之——实现圆角Button的更多相关文章

  1. Android 自己定义UI圆角button

    Android实际开发中我们一般须要圆角的button,普通情况下我们能够让美工做出来对应的button图片.然后放上去就可以,另外我们能够在布局文件里直接设置,也能够达到一样的效果. 以下解说在布局 ...

  2. android开发学习笔记:圆角的Button

    转自:http://www.cnblogs.com/gzggyy/archive/2013/05/17/3083218.html 在res目录下的drawable-mdpi建立xml文件shape.x ...

  3. android学习日记03--常用控件button/imagebutton

    常用控件 控件是对数据和方法的封装.控件可以有自己的属性和方法.属性是控件数据的简单访问者.方法则是控件的一些简单而可见的功能.所有控件都是继承View类 介绍android原生提供几种常用的控件bu ...

  4. Android 圆角Button

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbEAAADrCAYAAADnsqiUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAA

  5. Android学习系列(17)--App列表之圆角ListView(续)

    http://www.cnblogs.com/qianxudetianxia/archive/2011/09/19/2068760.html   本来这篇文章想并到上篇Android学习系列(16)- ...

  6. Android怎样设置圆角button

    1. 在res文件夹下的drawable文件夹下新建shape.xml文件 <?xml version="1.0" encoding="utf-8"?&g ...

  7. 【转】Pro Android学习笔记(十五):用户界面和控制(3):Button控件

    目录(?)[-] 基础Button ImageButton ToggleButton CheckBox RadioButton 基础Button Button是最常用的基础控件之一,在Android中 ...

  8. Android学习笔记⑤——UI组件的学习TextView相关

    TextView是一个强大的视图组件,直接继承了View,同时也派生出了很多子类,TextView其作用说白了就是在布局中显示文本,有点像Swing编程中的JLabel标签,但是他比JLabel强大的 ...

  9. 【转】Pro Android学习笔记(三):了解Android资源(上)

    在Android开发中,资源包括文件或者值,它们和执行应用捆绑,无需在源代码中写死,因此我们可以改变或替换他们,而无需对应用重新编译. 了解资源构成 参考阅读Android学习笔记(三八):资源res ...

随机推荐

  1. ARKit从入门到精通(9)-ARKit让飞机跟着镜头飞起来

    1.1-ARKit物体跟随相机移动流程介绍 1.2-完整代码 1.3-代码下载地址 废话不多说,先看效果 1001.gif 1.1-ARKit物体跟随相机移动流程介绍 1.点击屏幕添加物体,已经在第三 ...

  2. [转]Teleport Ultra/Teleport Pro的冗余代码批量清理方法

    原文地址:http://www.abcd9.com/?post=402 Teleport Pro 是款优秀的网站离线浏览工具(即网站整站下载工具),Teleport Ultra是其增强版,但使用此系列 ...

  3. poj 2482 Stars in Your Window (线段树扫描线)

    题目大意: 求一个窗体覆盖最多的星星的权值. 思路分析: 每个星星看成 左下点为x y 右上点为x+w-1 y+h-1 的矩形. 然后求出最大覆盖的和. #include <cstdio> ...

  4. Centos 6.5 安装Xrdp 远程桌面

    1. 安装源: Once you determine your architecture then you can install the correct EPEL repository with t ...

  5. FileChannel类的理解和使用

    FileChannel类的理解和使用(java.nio.channels.FileChannel) 知识点: 1.FileChannel类及方法理解:2.普通输入输出流复制文件:3.FileChann ...

  6. docker监控

    [编者的话]这篇文章作者是Usman,他是服务器和基础架构工程师,有非常丰富的分布式构建经验.该篇文章主要分析评估了五种Docker监控工具,包括免费的和不免费的:Docker Stats.CAdvi ...

  7. 首部讲Python爬虫电子书 Web Scraping with Python

    首部python爬虫的电子书2015.6pdf<web scraping with python> http://pan.baidu.com/s/1jGL625g 可直接下载 waterm ...

  8. Java获取mysql数据库元数据

    修改后的版本: package com.genratesql.util; import java.sql.Connection; import java.sql.DatabaseMetaData; i ...

  9. Altium Designer 规则设置

    设计规则设置 Designer Rules Check(DRC) Electrical 电气规则.安全间距,线网连接等 Routing 布线,线宽.过孔形状尺寸.布线拓扑.布线层.封装出线等 SMT ...

  10. 基于Zookeeper的分步式队列系统集成案例

    基于Zookeeper的分步式队列系统集成案例 Hadoop家族系列文章,主要介绍Hadoop家族产品,常用的项目包括Hadoop, Hive, Pig, HBase, Sqoop, Mahout, ...