<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" ><!-- android:shape="" 表示是圆角矩形还是椭圆等等 --> <solid android:color="#ffffff"/> <!-- 背景颜色 --> <!-- padding 表示内部空间距离背景图片内部边距 的距离 --> <padding android:left="5dp" android:top="2dp" android:right="5dp" android:bottom="2dp" /> <stroke android:width="0.5dp" android:color="#D9D9D9"/> <!-- 图片边框属性 --> <corners android:radius="5dp" /> <!-- 圆角的程度 --> <gradient android:startColor="#E3E3E3" android:centerColor="#ffffff" android:endColor="#ffffff" android:type="linear" android:angle="90" android:centerX="0.5" android:centerY="0.5" /> </shape>
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" ><!-- android:shape="" 表示是圆角矩形还是椭圆等等 --> <solid android:color="#ffffff"/> <!-- 背景颜色 --> <!-- padding 表示内部空间距离背景图片内部边距 的距离 --> <padding android:left="5dp" android:top="2dp" android:right="5dp" android:bottom="2dp" /> <stroke android:width="1.0dp" android:color="#C6E2FF"/> <!-- 图片边框属性 --> <corners android:radius="5dp" /> <!-- 圆角的程度 --> <gradient android:startColor="#C2C2C2" android:centerColor="#ffffff" android:endColor="#ffffff" android:type="linear" android:angle="90" android:centerX="0.5" android:centerY="0.5" /> </shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_pressed="true" android:drawable="@drawable/round_rectangle_bg_pressed" /> <!-- pressed --><item android:state_focused="true" android:drawable="@drawable/round_rectangle_bg_pressed" /> <!-- focused --><item android:state_selected="true" android:drawable="@drawable/round_rectangle_bg_pressed" /> <!-- selected --><item android:drawable="@drawable/round_rectangle_bg" /> <!-- default bg_list_item_normal --></selector>
把它当做图片上使用就好了
- android实现圆角矩形背景的方法
- Android开发笔记——圆角和边框们
- 消除使用activityGroup时, 子Activity的上黑边框
- android 计算地图上两点距离的算法
- android圆形有边框无背景色
- 如何获取Android RecyclerView滑动的距离
- Android 如何提前知道fling velocity的距离、时间 根据滑动距离
- android shape的使用详解以及常用效果(渐变色、分割线、边框、半
随机推荐
-
android之Fragment静态实现实例
-
android updater-scrip
-
Android TimeUtile日期处理工具类(干货)
-
android VoiceRecognition 语音识别并打
-
How to Install Ubuntu on Android!
-
android仿qq分组列表效果
-
android包重复问题
-
android根据应用方向自动旋转的自定义vie
-
Android录音及播放功能实现
-
Android 文件操作工具类