Rotate inside layer-list item is being cropped
<p>I'm having a problem with layer-list on Android. I want to do a simple pile of images. I can achieve that with the following code:</p>

<pre><code>&lt;layer-list
xmlns:android="http://schemas.android.com/apk/res/android"&gt;

&lt;item&gt;
    &lt;rotate 
        android:pivotX="50%" android:pivotY="50%"
        android:fromDegrees="0" android:toDegrees="0"&gt;
        &lt;bitmap
            android:src="@drawable/teste1"
            android:gravity="center" /&gt;
    &lt;/rotate&gt;
&lt;/item&gt;

&lt;item&gt;
    &lt;rotate 
        android:pivotX="50%" android:pivotY="50%"
        android:fromDegrees="-9" android:toDegrees="-9"&gt;
        &lt;bitmap
            android:src="@drawable/teste3"
            android:gravity="center" /&gt;
    &lt;/rotate&gt;
&lt;/item&gt;

&lt;item&gt;
    &lt;rotate 
        android:pivotX="50%" android:pivotY="50%"
        android:fromDegrees="9" android:toDegrees="9"&gt;
        &lt;bitmap
            android:src="@drawable/teste2"
            android:gravity="center" /&gt;
    &lt;/rotate&gt;
&lt;/item&gt;

&lt;/layer-list&gt;
</code></pre>

<p>But when I run it, the result is cropped on the top and on the bottom, as seen on the following image:</p>

<p><img src="http://i.stack.imgur.com/s9IXc.png" alt="cropped_image"></p>

<p>I have another doubt: if I put an ID on the <code>&lt;item&gt;</code> how do I retrieve it on my View so I can change the bitmap in code? The <a href="http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList" rel="nofollow">documentation</a>* says I have to use an View.findViewByID, but I want to get the BitmapDrawable, and I can't cast a View to a Drawable!</p>

<p>I also tried coding the same thing on a CustomView, with Canvas.drawBitmap, but it's looking very ugly, if someone can point out a good solution using that I would appreciate too.</p>

<p>Thanks in advance</p>
