Skip to content Skip to sidebar Skip to footer

Rounded Scaled ImageView From Right Side Only

How can I round an image that is scaled (CenterCrop) from right-top and right-bottom (all right side) only. This is what I am trying to do. I found that class that can do similar

Solution 1:

you can use drawable shape for this :

<?xml version="1.0" encoding="UTF-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <solid android:color="#FFFFFF"/>
        <stroke android:width="3dip" android:color="#B1BCBE" />
        <corners android:bottomLeftRadius="0dp" android:bottomRightRadius="10dp"
            android:topLeftRadius="0dp" android:topRightRadius="10dp"/>
        <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
    </shape>

imageView.setBackground(this.getResources().getDrawable(R.drawable.my_shape));

also check this link question how-to-make-an-imageview-with-rounded-corners


Post a Comment for "Rounded Scaled ImageView From Right Side Only"