2.5 创建颜色渐变效果(xml配置文件)
发布时间:2020-12-15 23:19:52 所属栏目:百科 来源:网络整理
导读:shape Drawable 形状资源 ? xml version = "1.0" encoding = "utf-8" ? shape xmlns:android = "http://schemas.android.com/apk/res/android" android:shape = "rectangle" corners //边角弧度,可以设置圆角矩形 android:topLeftRadius = "2dip" android:to
shape Drawable 形状资源
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
shape
xmlns:android
=
"http://schemas.android.com/apk/res/android"
android:shape
=
"rectangle"
>
<
corners //边角弧度,可以设置圆角矩形
android:topLeftRadius
=
"2dip"
android:topRightRadius
=
"2dip"
android:bottomLeftRadius
=
"2dip"
android:bottomRightRadius
=
"2dip"
/>
<
gradient //颜色渐变
android:startColor
=
"#66ff00"
android:endColor
=
"#5566ff00"
android:angle="90" //渐变角度 0:水平渐变 90:数值渐变
></
gradient
>
<
padding //距离控件边距
android:left
=
"5dip"
android:top
=
"5dip"
android:right
=
"5dip"
android:bottom
=
"5dip"
></
padding
>
<stroke //指定边框
android:width="1dip"
//边框宽度
android:color="#000000"
android:dashWidth="10dip"
//边框虚线长度
android:dashGap="5dip"
//边框虚线间隙
></stroke>
</
shape
>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |