Anil M H
Anil M H

Reputation: 3342

Android custom list view?

In my layout I need a custom list view like a box type.

How can do that ?

My XML:

   <LinearLayout
     android:layout_width="fill_parent"
     android:layout_height="317dp"
     android:gravity="top"
     android:orientation="vertical"
     android:background="@android:color/transparent"
    >

     <ListView android:id="@+id/slistview" 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:divider="#2867EA"
        android:dividerHeight="1dp"
        android:cacheColorHint="#00000000"
        >
     </ListView>

 </LinearLayout>     

Upvotes: 0

Views: 176

Answers (3)

Lalit Sharma
Lalit Sharma

Reputation: 1150

Create a xml for row of the list view and set the background of the row and create a custom adapter and set adapter to list view.

custom list view

Upvotes: 0

user2454606
user2454606

Reputation:

You can use customBaseadapter and viewHolder ...

Upvotes: 0

Ranco
Ranco

Reputation: 893

You should create custom list adapter and supply xml layout for each row. here's a comprehensive tutorial that fits your needs:

Link

Upvotes: 2

Related Questions