1

I want to make round image by code with gradiant color like this pictureenter image description here

mostafa hashim
  • 360
  • 1
  • 5
  • 24

3 Answers3

4

Check this solution https://github.com/vinc3m1/RoundedImageView It works for me.

Example with border:

        <RoundedImageView
            android:id="@+id/imageViewAvatar"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_gravity="center_horizontal|bottom"
            android:background="@drawable/border"
            android:cropToPadding="true"
            android:padding="7dp"
            android:scaleType="centerCrop"
            my:is_oval="true"
            my:round_background="false" />

Where border is your png with any border you want. All you need is set padding, that wiil be a distance between your image and border. And Set the image, of course.

grig
  • 848
  • 6
  • 15
0

this is an Lib for android u can use this https://github.com/pungrue26/SelectableRoundedImageView

Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28
  • but i want make border with 3 colors or put the border as image drawable as picture shows , not one color for the border , i tried all off this answers before – mostafa hashim Dec 24 '14 at 13:29
0

You can use RoundedImageView library.

Or, take a look at this if you don't want to use a library.

Community
  • 1
  • 1
max59
  • 606
  • 1
  • 7
  • 16