shope实例
来源:互联网 发布:淘宝上的缩阴棒放心吗 编辑:程序博客网 时间:2024/05/17 23:21
//建立于drawable文件//文件名:xxx.xml<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 背景颜色--> <solid android:color="#ffffff" /> <!-- 边的粗细,及边的颜色 --> <stroke android:width="1.0px" android:color="#000000" /> <!-- 四个角的圆角设置,值越大,角越圆 --> <corners android:radius="10.0dip" /> <padding android:left="1.5px" android:top="1.5px" android:right="1.5px" android:bottom="1.5px" /> <!-- 开始颜色,结束颜色 --> <gradient android:startColor="#ff8c00" android:endColor="#FFFFFF" android:angle="270" /> </shape>//控件<Buttonandroid:layout_height="content_wrap"android:layout_width="content_wrap"android:background="@drawable/xxx"/>