Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageView with only two corners rounded? [closed]

Tags:

android

I want to have an ImageView with top right corner & bottom left corner rounded.

<corners 
android:topRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="0dp"
android:bottomRightRadius="0dp"/>

Tried the above code , but it's not working.Please help!

like image 243
vaibvorld Avatar asked Sep 10 '12 06:09

vaibvorld


People also ask

How do I make rounded corners in paint?

In the upper left corner, select “Draw Filled Shape“. Draw the rounded rectangle over the area you would like to keep for your rounded corners image. Use the Magic Wand to select the area of the rounded rectangle. Select “Edit” > “Invert Selection“.

Can ImageView be clickable?

Using clickable imagesYou can turn any View , such as an ImageView , into a button by adding the android:onClick attribute in the XML layout. The image for the ImageView must already be stored in the drawable folder of your project.


1 Answers

I am using this it works fine for me

<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >

        <solid android:color="#FFFFFF" />

        <corners
            android:bottomLeftRadius="10dp"
            android:bottomRightRadius="10dp"
            android:topLeftRadius="0dp"
            android:topRightRadius="0dp" />

        <stroke
            android:width="1dp"
            android:color="#000000" />

    </shape>
like image 62
Ashwani Tyagi Avatar answered Oct 21 '22 20:10

Ashwani Tyagi