xml实现shape,作为背景
来源:互联网 发布:saas平台多租户源码 编辑:程序博客网 时间:2024/05/18 02:48
矩形:
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffffff" /> <!-- 设置几何图形四个角的弧度 --> <corners android:radius="3dp"/> <!-- 设置几何形状绘制边框 红色边框 --> <stroke android:color="#CD2626" android:width="1dp"/></shape>
实现多层阴影边框:
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 第一层 上部和左部偏移一定距离--> <item android:top="2dp"> <shape> <solid android:color="#FFFFFF" /> <!-- 描边 --> <stroke android:width="0.5dp" android:color="#D2D2D2" /> </shape> </item> <!-- 第二层 下部和有部偏移一定距离--> <item android:bottom="2dp"> <shape> <solid android:color="#ffffff" /> <!-- 描边 --> <stroke android:width="0.5dp" android:color="#D2D2D2" /> </shape> </item></layer-list>
设置2dp的padding,adp外面再设置一个边框:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/update_float_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" android:padding="2dp" android:background="@drawable/update_apk_container_background"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal" android:gravity="center_vertical" android:background="@drawable/update_apk_float_background"> </LinearLayout></LinearLayout>
0 0
- xml实现shape,作为背景
- android View使用shape作为背景不能指定单边圆角的xml
- Android--(7)--Android Shape实现控件背景
- (shape)自己用XML绘制Button之类的背景
- Android背景渐变色(shape,gradient)的实现,gradient
- ANDROID SHAPE画圆形背景_ANDROID实现角标布局
- ANDROID SHAPE画圆形背景_ANDROID实现角标布局
- ANDROID SHAPE画圆形背景实现圆形TextView
- ANDROID SHAPE画圆形背景实现圆形TextView
- android shape实现控件圆角,背景,边框等属性
- ANDROID SHAPE画圆形背景_ANDROID实现角标布局
- shape .xml
- 用Shape 作背景
- android 字画背景 shape
- Android背景渐变[shape]
- shape黑线框背景
- 背景选择器selector/shape
- android shape 圆形背景
- 贪心——HDU 1009
- HTTPClient
- Android Mvp+Rxjava+Retrofit实战
- c/c++的时间
- POJ 3169-Layout(差分约束系统-入门裸题)
- xml实现shape,作为背景
- 关于项目部署到linux服务器上拍照图片无法预览问题
- 石油大oj 1825奇怪的电梯 bfs
- Java 循环结构 - for, while 及 do...while
- js随机生成不同颜色块随机移动
- 前端干货资源
- 如何在 Ubuntu Linux 16.04上安装开源的 Discourse 论坛
- 如何在 Ubuntu Linux 16.04上安装开源的 Discourse 论坛
- 【51Nod】1384 - 全排列(STL)