title: Android bitmap image size in XML
body: <p>In my XML file, I'm using bitmap as the following</p>
  
  <pre><code>&lt;bitmap
      android:src="@drawable/Icon"
      android:gravity="center"/&gt;
  </code></pre>
  
  <p>Here the image width of the icon exceeds the screen. </p>
  
  <p>I tried android:width="100dp" and all. But it isn't working.</p>
  
  <p>Complete XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;item&gt;
        &lt;shape android:shape="rectangle"&gt;
              &lt;stroke android:width="3dp" android:color="@color/black" /&gt;
              &lt;solid android:color="@color/bg_green" /&gt;
          &lt;/shape&gt;
     &lt;/item&gt;
     &lt;item&gt;
      &lt;bitmap
          android:src="@drawable/Icon"
          android:gravity="center"/&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>How can I reduce the width and height of the above bitmap?</p>