Rounded corner listview items Background issue in android 4.0.4 -
i have listview code given below
<listview android:id="@+id/listview01" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/relativelayout01" android:cachecolorhint="@android:color/transparent" android:choicemode="singlechoice" > </listview>
and here listview items layout
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:padding="5dp" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/listview_bg" > <linearlayout android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_aligntop="@+id/imgrealstatephoto" android:layout_marginleft="5dp" android:layout_margintop="10dp" android:layout_toleftof="@+id/imageview1" android:layout_torightof="@+id/imgrealstatephoto" android:orientation="vertical" > <textview android:id="@+id/txtrealstateaddress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="#7d7d7d" android:textsize="15sp" android:textstyle="bold" /> <textview android:id="@+id/txtrealstatehometypebroker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" android:maxlines="3" android:text="loading...." android:textcolor="#867c7d" android:textscalex="1.025" android:textsize="12sp" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignleft="@+id/linearlayout1" android:layout_alignparentbottom="true" android:layout_alignparentend="true" android:layout_below="@+id/linearlayout1" android:gravity="bottom" android:orientation="horizontal" > <textview android:id="@+id/txtrealstateprice" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.75" android:textcolor="#006b9e" android:textsize="12sp" android:textstyle="bold" /> <textview android:id="@+id/txtrealstatestatus" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/real_estate_text_bg_pending" android:ellipsize="end" android:gravity="center" android:maxlines="1" android:singleline="true" android:textcolor="@android:color/white" android:textsize="12sp" /> </linearlayout> <imageview android:id="@+id/imgrealstatephoto" android:layout_width="90dp" android:layout_height="90dp" android:layout_alignparentleft="true" android:layout_centervertical="true" android:scaletype="centercrop" android:src="@drawable/ellectedofficialsoverlay" /> <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_centervertical="true" android:src="@drawable/expand_ico" /> </relativelayout> </relativelayout> </relativelayout>
note: android:background="@drawable/listview_bg" in relative layout
here code of listview_bg.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="12dp" /> <stroke android:width="1dp" android:color="#6dd8f9" /> </shape>
output on android 4.0 qmobile noir
look whole background of listview items became black.
while in andorid 4.4.2 nexus 7 device , emulator m getting desired out come i.e
i want layout in 2nd image in devices. how resolve issue
add listview_bg.xml this:
<solid android:color="@android:color/transparent"/>
Comments
Post a Comment