how to make imageview border with two color and fix size border width in andorid

爱⌒轻易说出口 提交于 2019-12-08 05:17:32
Ronit kadwane

here is xml code and easy to maintain :

double_circle_image.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>

        <shape android:shape="oval">

            <stroke
                android:width="10dp"
                android:color="#0000ff" />
        </shape>
    </item>

    <item
        android:bottom="10dp"
        android:left="10dp"
        android:right="10dp"
        android:top="10dp">

        <shape android:shape="oval">

            <stroke
                android:width="10dp"
                android:color="#ff0000" />
        </shape>
    </item>
    <item
        android:drawable="@drawable/ic_launcher"
        android:bottom="20dp"
        android:left="20dp"
        android:right="20dp"
        android:top="20dp"/>
</layer-list>

Use this library to shape the image to circle. You add your image using tag, right? Then, add a background (shaded) (Vector) from drawable as well. It will enable to make the look like you wanted.

You should use vector file as your images as well. This is cool library to convert svg images to vector images. If you do so, your images will look like as your wished in the question, in any devices!

Hope it helps. Cheers!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!