您的位置:首页 > 其它

实现上半部分是直角,下半部分是圆角半圆角的效果

2016-01-08 00:00 316 查看
xml控件配置属性

android:background="@drawable/shape"

标签

corners ----------圆角
gradient ----------渐变
padding ----------内容离边界距离
size ------------大小 
solid  ----------填充颜色
stroke ----------描边

下面是shape文件代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp"/>

<gradient android:angle="270"
android:endColor="@color/transparent_black_40"
android:startColor="@color/transparent_black_15"/>

</shape>

希望对大家有点帮助吧
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: