Android 空心和实心按钮

Android 空心和实心按钮

做界面时 有时老要用到这种按钮 动画如下

实心的

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

    <!-- 实心圆 -->
    <solid android:color="@color/btn_1cacff" />

    <padding
        android:bottom="@dimen/x8_dp"
        android:top="@dimen/x8_dp" />
    <!-- 圆角半径 -->
    <corners android:radius="@dimen/x16_dp" />

    <!-- <stroke -->
    <!-- android:width="1px" -->
    <!-- android:color="#000" /> -->

</shape>

空心的

<?xml version="1.0" encoding="utf-8"?>
<!--空心圆角矩形  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
 
    <corners android:radius="8dp" /><!-- 圆角半径 -->
 
    <stroke
        android:width="2dp"
        android:color="#0000ff" /><!--矩形的边线  -->
 
    <size
        android:height="50dp"
        android:width="400dp" /><!--矩形的宽高  -->
 
    <gradient
        android:endColor="#fff"
        android:startColor="#fff" /><!-- 矩形的内部颜色,这里设置成白色,即空心 -->
 
</shape>

 

posted @ 2015-10-10 17:08  幻奕  阅读(1009)  评论(0编辑  收藏  举报