ImageView with only two angles?

I want the ImageView with the upper right corner and lower left corner to round.

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

Tried the above code, but it does not work. Please, help!

+4
source share
2 answers
 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@android:color/darker_gray"/> <corners android:topRightRadius="10dp" android:bottomRightRadius="0dp" android:topLeftRadius="0dp" android:bottomLeftRadius="10dp"/> </shape> 

This is my drawable shape.xml in a portable folder. And I use this feature to set the background of images.

 <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" android:background="@drawable/shape"/> 

Finished Appears when the application starts on the device / emulator (will not be displayed in the xml graphic layout)

+4
source

I use this, it works great 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> 
0
source

Source: https://habr.com/ru/post/1433300/


All Articles