Drop shadow around all the four sides of an EditText in Android Studio
<p>As far as my knowledge aids me, there isn't any property to drop shadow around an EditText field, that can be set in the layout file. I searched for the problem and found solution that I've to provide a custom background xml drawable.</p>
<p>My drawable/background_with_shadow looks like this:</p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;layer-lis xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
    &lt;item &gt;
        &lt;shape
            android:shape=&quot;rectangle&quot;&gt;
            &lt;solid android:color=&quot;@android:color/darker_gray&quot; /&gt;
            &lt;corners android:radius=&quot;5dp&quot;/&gt;
        &lt;/shape&gt;
    &lt;/item&gt;
    &lt;item android:right=&quot;1dp&quot; android:left=&quot;1dp&quot; android:bottom=&quot;2dp&quot;&gt;
        &lt;shape
            android:shape=&quot;rectangle&quot;&gt;
            &lt;solid android:color=&quot;@android:color/white&quot;/&gt;
            &lt;corners android:radius=&quot;5dp&quot;/&gt;
        &lt;/shape&gt;
    &lt;/item&gt;
&lt;/layer-list&gt;
</code></pre>
<p>and I'm setting this property for my <code>LinearLayout</code> which contains an <code>EditText</code></p>
<pre><code>&lt;LinearLayout
android:layout_width=&quot;match_parent&quot;
android:layout_height=&quot;match_parent&quot;
android:background=&quot;@drawable/background_with_shadow&quot;&gt;
&lt;EditText&gt;
.
.
&lt;/EditText&gt;
&lt;LinearLayout&gt;
</code></pre>
<p>However it just drops the shadow around the bottom and bottom corners.
How would I do it for all the four sides and corners?</p>
<p>I'm trying to achieve this:
<a href="https://i.stack.imgur.com/bCFKR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bCFKR.jpg" alt="enter image description here" /></a></p>