2
votes

I have a layerlist that I use as a background for a spinner. I'm trying to resize the bitmap that is one of the items in the layerlist. The problem is that there aren't any resizing traits that can be found. Please see code below:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff"/>
<stroke
    android:width="2dp"
    android:color="#80000000"/>
<padding
    android:bottom="2dp"
    android:left="2dp"
    android:right="2dp"
    android:top="2dp"/>

</shape>
</item>

<item>
    <bitmap
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:src="@mipmap/ic_launcher" />
</item>
</layer-list>

Here is a visual of what's happening:

enter image description here

How can I resize this bitmap? I'm trying to scale the image down because its too big. I've tried changing the layout width and height to a certain number and also resizing the image in an image editing program but nothing happened. Any help would be appreciated.

could you add image which will show what you have now and what you wana achive? Also, did you tried to add android:top and android:bottom with value 1dp to <item/> which contains the bitmap? - Selvin
hmmm I think mipmap is a bad choice for this ... use nine-patch drawable - Selvin
Added a picture. Trying to resize that image so the whole view doesn't overlap with other views. My guess is that the image is controlling the entire height of the view. I have not added a top or bottom. - user112016322