Note that there are some explanatory texts on larger screens.

plurals
  1. POMask ImageView with round corner background
    primarykey
    data
    text
    <p>I am having a <code>Custom ListView</code> which contains an <code>ImageView</code> and <code>TextView</code>. Everything is working fine.</p> <p>What I want is the image is displayed in list are in round corner. From the Webservice i get the images in rectangle shape. But i want to display it in Round corner <code>ImageView</code> as below.</p> <p><img src="https://i.stack.imgur.com/0fhAm.png" alt="enter image description here"></p> <p>Can anyone show me the way how can i mask the image in round corner? </p> <p>I already tried by creating the drawable file as below and applied it as src in <code>ImageView</code>. But nothing working for me.</p> <pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item&gt; &lt;shape android:shape="oval" &gt; &lt;solid android:color="#FFFFFF" /&gt; &lt;padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /&gt; &lt;corners android:radius="5dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item&gt; &lt;shape android:shape="oval" &gt; &lt;padding android:bottom="5dp" android:left="5dp" android:right="5dp" android:top="5dp" /&gt; &lt;solid android:color="#FFFFFF" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;/layer-list&gt; </code></pre> <p><strong>EDITED:</strong></p> <p><img src="https://i.stack.imgur.com/CSYOe.png" alt="enter image description here"> Please help me.</p> <p>Any help will be appreciated.</p> <p>Thanks</p> <p>I have Applied below solution:</p> <pre><code>&lt;FrameLayout android:id="@+id/imagemaskframe" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dp" &gt; &lt;ImageView android:id="@+id/op_ivpic" android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity="center" android:scaleType="fitXY" /&gt; &lt;ImageView android:id="@+id/iv_mask_op" android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity="center" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/imgmask" /&gt; &lt;/FrameLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload