android - How can I make a listview transparent, but the items opaque? -


i have listview transparent, however, want items opaque, how can acheive that?

here's listview.

<linearlayout     android:layout_width="0dp"     android:layout_height="match_parent"     android:layout_weight="0.29"     android:alpha="0.7"     android:background="@drawable/icon_list_left_border">      <listview         android:id="@+id/product_info_list_colors"         android:layout_margintop="48dp"         android:layout_marginbottom="16dp"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:scrollbars="vertical"         android:smoothscrollbar="true"         android:cachecolorhint="#00000000"         android:divider="@android:color/transparent"         android:dividerheight="20dp">      </listview>  </linearlayout> 

edit: can't set background item, i'm using circleimageview. item xml below:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:gravity="center">      <de.hdodenhof.circleimageview.circleimageview         android:id="@+id/color_icon"         android:layout_width="48dp"         android:layout_height="48dp"         android:scaletype="centercrop"         android:src="@color/coloraccent"/>      <de.hdodenhof.circleimageview.circleimageview         android:id="@+id/color_selected"         android:layout_width="16dp"         android:layout_height="16dp"         android:scaletype="centercrop"         android:src="@color/coloraccent"         android:visibility="gone"/>  </relativelayout> 

make background of layout, used listview's item, opaque.

for example:

<?xml version="1.0" encoding="utf-8"?> <textview xmlns:android="http://schemas.android.com/apk/res/android"           android:layout_width="match_parent"           android:layout_height="wrap_content"           android:background="@android:color/white"           android:padding="16dp"> </textview> 

ps: layout of listview items used in getview(int position, view convertview, viewgroup parent) method of listview adapter create view items.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -