Designing EditText with Rounded Corners and Inner Shadow

I am trying to create my own EditText that has both rounded corners and an inner shadow.

enter image description here

I created a list of layers that creates an inner shadow,

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item > <shape android:shape="rectangle"> <solid android:color="#6C6C6C" /> </shape> </item> <item> <shape android:shape="rectangle"> <solid android:color="@color/ashes" /> </shape> </item> <!-- White Top color --> <item android:top="3px" android:left="3px"> <shape android:shape="rectangle"> <solid android:color="#FFFFFF" /> </shape> </item> </layer-list> 

The result is as follows:

enter image description here

How can I add a rounded shape?

+7
android android-layout android-ui
source share
1 answer

Add the corners tag to the shape tags:

  <corners android:radius="5dp" /> 
+2
source share

All Articles