I am trying to create a custom drawable that includes a background image with 9 patches (named custom_bg below) and a regular png image (accordion_up). The latter should not be scaled.
I tried several options for something line by line:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/custom_bg"/> <item android:layout_width="10dp" android:layout_height="10dp" android:drawable="@drawable/accordion_up" android:gravity="right" /> </layer-list>
I tried different values ββfor layout_width / layout_height , as well as width / height , but all I get is an accordion image stretched to fill the whole view. I would like it to float in the upper right corner of the view, scaled only to match the dpi on the device, but was not expanded to fit the view. How can i do this?
source share