circle_corner.xml

<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android">     <solid android:color="#606060" />     <corners android:topLeftRadius="10px"         android:topRightRadius="10px" android:bottomLeftRadius="10px"         android:bottomRightRadius="10px"/>     <padding android:left="0dp" android:top="0dp" android:right="0dp"         android:bottom="0dp" /> </shape>

然后调用

android:background="@drawable/circle_corner"

OR

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="5dip" android:color="#FFFF00" /><!-- 描边 :边框宽度与颜色 --> <padding android:left="20dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /><!-- 主要内容的padding 文字距离上下左右的距离 --> <corners  android:radius="9dip" /><!-- 圆角的半径  也可以统一设置半径 android:radius="9dip"-->    <gradient  android:startColor="#ff8c00"  android:endColor="#FFFFFF"  android:angle="270" />     <!-- 渐变 -->   <solid android:color="#FFEFD5" /> <!-- 没有描边的中间部分 --><!--solid 与  gradient 只能显示在代码最后那个--></shape>

更多相关文章

  1. Android中自定义Checkbox
  2. Android之Selector、Shape介绍
  3. android 自定义progressbar 样式
  4. android之shape使用
  5. Android如何使用XML创建一个环形渐变颜色图片
  6. Android深度定制化TabLayout:圆角,渐变色,背景边框,基于Android原生T
  7. android仿今日头条个人中心页面
  8. XML-SHAPE
  9. Android获取RecyclerView滑动距离

随机推荐

  1. c语言中int范围是多少?
  2. C语言中switch语句的case后能否是一个关
  3. c语言中return的用法是什么?
  4. #include和#define是C语句吗?
  5. c语言中标识符不能与保留字同名吗?
  6. C语言中有且唯一的函数是什么
  7. C语言中取地址运算符是什么?
  8. 两分钟带你了解如何使用“strcpy()”函数
  9. putchar函数可以向终端输出一个字符么
  10. C语言怎么获取数组的长度