nhanamnguyenngoc
New Member
I'm trying to create a complex xml drawable to represent a listbox, setting it as a background of a TextView.Following there is there a screenshot of what I want to obtain and what I get instead.
As you can see I want to put my arrow in a gradient gray box on the right.Looking at android documentation, it seems that xml shapes supports the size tag, as reported here http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape , but i can't get it working!Here there is my XML\[code\]<?xml version="1.0" encoding="UTF-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#999999" /> <corners android:radius="5dp" /> <solid android:color="#ffffff" /> </shape> </item> <item> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#999999" /> <corners android:topRightRadius="5dp" android:bottomRightRadius="5dp" /> <gradient android:startColor="#606060" android:endColor="#303030" android:angle="270" /> <padding android:top="7dp" android:bottom="7dp" android:right="7dp" /> </shape> </item> <item> <bitmap android:src="http://stackoverflow.com/questions/12542667/@drawable/listbox_arrow_icon" android:gravity="right|fill_vertical" android:tileMode="disabled" /> </item></layer-list>\[/code\]I tried specifying android:width in shape tag, as specified here http://developer.android.com/refere...rawable/ShapeDrawable.html#attr_android:width, but it doesn't work too.I don't want to do it using code, but if it's unavoidable, in the end, I think i'll build a component to use in the place of TextView for this stuff.Thanks for your help!@EDITSorry, during copy&paste I dropped the solid tag of the first shape! Fixed!