android - How to customize a ListView row to get a glass background? -


i trying glass background each row of listview. using following codes getting glass background whole listview. want glass background each row. posting xml code below. please suggest how can glass background rows , not whole of listview.

xml file:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:paddingbottom="@dimen/activity_vertical_margin"    android:paddingtop="@dimen/activity_vertical_margin"    tools:context=".lists"    android:background="@drawable/backgnd" >   <listview     android:id="@+id/listview1"     android:layout_width="fill_parent"     android:layout_height="250dp"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:longclickable="true"     android:background="#20535252"     android:layout_below="@+id/relativelayout1" >  </listview> 

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:paddingbottom="@dimen/activity_vertical_margin"    android:paddingtop="@dimen/activity_vertical_margin"    tools:context=".lists"    android:background="@drawable/backgnd" >   <!-- custom views -->  </relativelayout> 

now use layout inflate listview's item. can use custom adapter :-

  public class youradapter extends baseadapter {            public int getcount() {             return itemlist.size();         }          public object getitem(int position) {             return itemlist.get(position);         }          public long getitemid(int position) {             return position;         }          public view getview(int position, view view, viewgroup parent) {  //inflate layout here :-             if(view ==null)                 view = layoutinflater.inflate(r.layout.yourlayout, null);                return view;          }      } 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -