--ADVERTISEMENT--

How to Make Roundness in the Corners(Boarder Radius) in an Image of ImageView in Android. In this tutorial, you will learn to make an ImageView rounded corner using java code. By default in android ImageView don’t have option to make corners rounded(border radius). But if you need corner radius, you can make it by different ways. Follow following example step by step to make rounded corner of ImageView images.

Related:
How to Rotate an Image in Android
How to Create Vertical and Horizontal Lines in Android Using XML
Buttons - Android Button Examples

Android Example: Make an ImageView Image Rounded Corners in Android


XML Layout File
Following is the simple android xml layout with a LinearLayout and an ImageView. This ImageView has an id image_view.
res/layout/activity_main.xml

Java Activity File
Following is the java code to make ImageView image corner rounded(border radius) . Following is the final code of MainActivity.java file.
src/MainActivity.java

Following is the default strings of strings.xml file.
res/values/strings.xml

Following is also the default content of AndroidManifest.xml file.

After running your application the output looks like below:

Output:
How to Make Rounded Corners(Boarder Radius) in an Image of ImageView in Android
Android ImageView Rounded Corners(Boarder Radius)

Download Complete Example Project

Download complete How to Make Roundness in the Corners(Boarder Radius) in an Image of ImageView in Android project source code from GitHub.

Post a Comment

Powered by Blogger.