title: Android View background: How to specify background color for PNG transparency?
body: <p>I want my Android View's background to be the logo on a white background.</p>
  
  <p>I can make my View's background white:</p>
  
  <pre><code>android:background="@color/colorWhite"
  </code></pre>
  
  <p>I can make my View's background a PNG:</p>
  
  <pre><code>android:background="@drawable/logo"
  </code></pre>
  
  <p>But not both at the same time (<code>Attribute "android:background" was already specified</code>).<br>
  If I write only <code>@drawable/logo</code> then the logo is drawn on a black background.
  How to do? Preferably without adding a layer of view.</p>
  
  <hr>
  
  <p><strong>SOLUTION:</strong> I used Avinazz's first suggestion, and here is the code:</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 android:drawable="@color/white"/&gt;
      &lt;item&gt;
          &lt;bitmap android:src="@drawable/logo"
          android:gravity="center" /&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>With <code>strings.xml</code> containing <code>&lt;color name="white"&gt;#FFFFFF&lt;/color&gt;</code>.</p>