I need to set image as icon in my application, it needs to make image have rounded corners, I don't want to crop image, how can I achieve it? which methods I need to use? Which scaling type I need to use?
Asked
Active
Viewed 335 times
0
-
refer [this](http://stackoverflow.com/questions/2459916/how-to-make-an-imageview-with-rounded-corners) – dora May 23 '15 at 13:56
1 Answers
0
Use the shape background for image
Create a file called bg_back.xml in your drawable directory.
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="3dip" android:color="#B1BCBE" />
<corners android:radius="10dip"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip"
android:bottom="0dip" />
</shape>
Call this in your ImageView
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_back"/>

Zeeshan Ali
- 667
- 8
- 16

nifCody
- 2,394
- 3
- 34
- 54