Skip to content Skip to sidebar Skip to footer

How To Align List View To The Top Of The Page

My list items appear at the bottom part of the page, i mean, last item is at the bottom of screen and others are built on top of it. I want the first item on top of screen and othe

Solution 1:

Don't align your ListView to the bottom. More specific, remove both alignment lines:

<ListView
    android:id="@+id/linkList"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

alignParentTop takes a boolean, not a reference. Also, this is standard, so you don't need it here. alignParentBottom is what causes your problem, you're aligning to the bottom of the parent.

Also, wrap_content on a ListView height is generally a bad idea.

Post a Comment for "How To Align List View To The Top Of The Page"