Android让按钮或控件圆角让被景圆圈

来源:互联网 发布:java游戏破解版下载 编辑:程序博客网 时间:2024/06/05 20:01

//控件圆角


<shape xmlns:android="http://schemas.android.com/apk/res/android"

    android:shape="rectangle"
    android:padding="3dp"
    >
    <solid
        android:width="3.0dip"  
        android:color="#FFFFFF"
        />   
    <corners
        
             android:topLeftRadius="19dp"  
             android:topRightRadius="19dp"   
             android:bottomRightRadius="18dp"  
             android:bottomLeftRadius="18dp"/>
             
 

</shape>


控件圆圈


<shape xmlns:android="http://schemas.android.com/apk/res/android"
    
    android:shape="oval"
    android:useLevel="false"  >
    
    
     <!-- 设置边框的大小和颜色 -->
    <stroke
        android:width="2.0dip"
        android:color="#ffffff" />
 
    <!-- 设置图形内的颜色,此处为透明色 -->
    <solid android:color="#00000000" />
    

 
    <!-- 定义圆角弧度 圆的话就是半径 -->
    <corners
        android:bottomLeftRadius="75dp"
        android:bottomRightRadius="75dp"
        android:topLeftRadius="75dp"
        android:topRightRadius="75dp"
        />
    
</shape>

0 0