Android设置单边圆角边框
来源:互联网 发布:mac 装win10 安装u盘 编辑:程序博客网 时间:2024/04/30 08:55
在drawable新建一个 buttonstyle.xml的文件,内容如下
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 连框颜色值 -->
<item>
<shape>
<solid android:color="#ffffff" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp"/>
<stroke
android:width="1dp"
android:color="#f00" />
</shape>
</item>
<!-- 主体背景颜色值 -->
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp">
<shape>
<solid android:color="#ffffff" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
<corners
android:topLeftRadius="0dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp" />
</shape>
</item>
</layer-list>
然后在布局文件里面的Button里面设置如下:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1"
android:background="@drawable/buttonstyle" />
效果图:
- Android设置单边圆角边框
- android 设置边框圆角
- Android开发:ImageView 设置圆角边框
- Android XML设置圆角边框
- android控件设置边框和圆角
- ios 修改单边圆角
- 设置边框圆角
- 设置边框 设置圆角
- TextView四周边框和单边边框
- border-image 单边设置
- Android给TextView设置透明背景、圆角边框
- Android给TextView设置透明背景、圆角边框
- Android开发之给控件设置圆角边框
- css3设置圆角边框
- 设置图片圆角边框
- android圆角边框
- Android边框圆角
- Android 边框圆角
- opengl坐标转换
- Vijos1022. Victoria的舞会2
- poj 3273 Monthly Expense(二分查找)
- leo学习系列之二——leo启动运行
- 2-11. 两个有序链表序列的合并(15) (ZJU_PAT 链表 | vector)
- Android设置单边圆角边框
- 程序实践系列(四)使用类设计整数集合类
- TCP三次握手和四次握手最直接的理解
- Mysql ndb cluster初试
- 彩笔系列nodejs之调试
- 关于:findViewById()返回null的问题和如何获取Fragment中的组件
- hdu 1598 并查集+枚举最小权值
- ZOJ-#3529 A Game Between Alice and Bob(Nim和+素数因子)
- win32 application之MessageBox