How to make image fit the whole width screen without blank space in android?
<p>Tried to make image taken to fit the whole screen size width, and top</p>

<p>Picture output should be like this:</p>

<p><a href="https://i.stack.imgur.com/47vqS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/47vqS.jpg" alt="should be like this"></a></p>

<p>The output on the screen of my app is as below with blank space on top, left and right side.</p>

<p><a href="https://i.stack.imgur.com/CfWSf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CfWSf.png" alt="Image output 2"></a></p>

<p>My XML for the activity layout is below:</p>

<pre><code>         &lt;RelativeLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/vestGlavnaSlikaLayout"
            android:layoutDirection="ltr"&gt;

            &lt;ImageView
                android:id="@+id/iv"
                android:layout_width="match_parent"

                android:fitsSystemWindows="false"
                android:scaleType="fitXY"
                android:layout_marginTop="-20dp"
                android:focusable="false"
                android:cropToPadding="false"
                android:adjustViewBounds="true"
                android:layout_alignParentBottom="false"
                android:layout_alignParentRight="false"
                android:layout_height="wrap_content"
                android:layout_marginLeft="-20dp"
                android:layout_alignParentEnd="false"
                android:layout_marginRight="-20dp" /&gt;

            &lt;TextView
                android:background="@android:color/black"

                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/tekstglavnevesti"
                android:textColor="@android:color/background_light"
                android:textSize="20dp"
                android:layout_alignParentBottom="true"
                android:layout_alignParentStart="true"
                android:textStyle="normal|bold" /&gt;

        &lt;/RelativeLayout&gt;
</code></pre>

<p>My code to display the image:</p>

<pre><code>    ImageView iv = (ImageView) v. findViewById(R.id.iv);
     Picasso.with(getActivity()).load(slikeZaVesti.get(0))
                            .into(iv); // jpg tag is pasrsed from html
</code></pre>

<p>As you l might observe, there are blank spaces at both left and right side of the image. Any way to make the image fit perfectly onto the screen?</p>