Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Implementing Designs for Android Customizing a ListView for the Inbox Adding Margins to ListViews

Luís Ramalho
Luís Ramalho
6,698 Points

Gray line under each item in the ListView

In my ListView I had to add the attribute android:divider="@null" in order to remove the divider that supposedly appears by default.

<ListView
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:id="@android:id/list"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:paddingBottom="@dimen/inbox_vertical_margin"
    android:clipToPadding="false"
    android:divider="@null"
    />
Harry James
Harry James
14,780 Points

Hey Luis! Could you provide a screenshot and I'll take a look? :)

Luís Ramalho
Luís Ramalho
6,698 Points

Hi Harry! After moving to the next lesson I noticed that Ben fixed the problem. I just leave this note here for the next person if they wonder why they see a gray line under each item on the list. Thank you for your time!

Harry James
Harry James
14,780 Points

Ah! Sorry!

I thought you were meaning that once you added that line you got the grey lines (That's why I asked for a screenshot - I've never seen that happen before in an XML file).

And yes, please add tips like this onto the forums! Me and many other users check the Questions tab first when there's a problem so it's a great way to share your fixes! :)