Home > Android > Android practice – ListView With Round Corner

Android practice – ListView With Round Corner

1, Use the shape tag to create a drawable[listview_roundcorner_item.xml] with rounded corners. Like ,

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle" >

 android:startColor="#E77A26" />

 android:topRightRadius="8dp" />


2, There are two ways to implement it .

  • Add attribute to ListView


  • Set background by sourcecode


3, Finally , if you run this example you would get the following effect.

Categories: Android
  1. JJ
    November 4, 2012 at 7:47 pm

    Clean and simple example..

    Already new this, but found your blog by “accident”..

    Nice to see that this can be written down in a simple way. Too many complicated explanations out there..

    Thumbs up!

  2. N.Nagaganesh
    February 11, 2013 at 8:58 pm

    Big Thanks to you.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: