ARGB not working properly in Android app -
i trying apply transparent background row when pressed in listview. create file list_selector.xml this:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/argb80804040" /> </selector>
and in news_item.xml, define ground follow:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/list_selector"> <imageview android:id = "@+id/img" android:layout_width="95dip" android:layout_height="75dip" android:layout_alignparentleft = "true" android:paddingtop="10dip" android:layout_marginleft="10dip" android:paddingbottom="10dip" android:src="@drawable/no_news_image_small" /> <textview android:id="@+id/title" android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_weight="1.0" android:layout_height="wrap_content" android:textsize="12sp" android:textstyle="bold" android:paddingtop="5dip" android:layout_marginleft="110dip" android:textcolor="#21b6ef" android:singleline="true" /> <textview android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_weight="1.0" android:layout_height="wrap_content" android:layout_marginleft="110dip" android:textsize="10sp" android:id="@+id/description" android:layout_below="@id/title" android:paddingbottom="10dip" android:layout_marginbottom="5dip" android:textcolor="#fff"/> </relativelayout>
however, displays solid color instead of argb color. drawable define follow:
<resources> <item type="drawable" name="transparent_orange">#64ff7b00</item> <item type="drawable" name="argb80804040">#80804040</item> <item type="drawable" name="argb40000000">#40000000</item> <item type="drawable" name="argb80408040">#80408040</item> </resources>
do need else aplha color working? trying on own device (motorola defy), , using application uses same alpha color , color appears ok in application, in mine, doesnt.
many response t
i don't understand want achieve proposal be
define colors in res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="transparent_orange">#64ff7b00</color> ... </resources>
then can define drawable used background in res/drawable/test.xml:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/transparent_orange" /> </shape>
finally, can use resulting drawable attribute of target container
android:background="@drawable/blue_linear_gradient"
Comments
Post a Comment