Applying a background image to a form

I donโ€™t know if I ask if itโ€™s wrong or not. But can I have an image in this xml form so that, if you provide an image, its angles are rounded.

<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="5dp" /> <solid android:color="#F87217"/> <stroke android:width="1dip" android:color="#f0f0f0" /> </shape> 
+4
source share
1 answer

You can try this

 <item android:drawable="@drawable/ic_broadcast" android:left="3px" android:right="3px" android:top="3px"> <shape android:shape="rectangle" > <solid android:color="#cc2b2b" /> <corners android:radius="8dp" /> </shape> </item> 

ic_broadcast is an image from the res folder

+1
source

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


All Articles