如何给android中imageview画一个有距离的边框

2025-03-21 05:20:42
推荐回答(2个)
回答1:

如果你的圆图设置的是src的话就加个android:background="@drawable/xxx",xxx如下.如果不是就相对布局

    android:shape="rectangle" >

    
            android:width="3.5dip"
        android:color="@color/white" />

    
    

    
            android:bottomLeftRadius="75dp"
        android:bottomRightRadius="75dp"
        android:topLeftRadius="75dp"
        android:topRightRadius="75dp" />

回答2:

根据理解,直接在资源文件里设置背景background,参考以下代码:

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@color/gray"
    android:padding="2dp"
    android:src="@drawable/about_logo" />