0

I've created a sliding menu application and I've added more items blocks, but now, I want to add some space beetwen the items and the titles .. To make an idea, I give you an image to see it exactly:

enter image description here

In the facebook sliding menu you can see that beetwen a new title and the item above is some space, and that space I want to know how to add.

P.S: Which is the size in pixels of an smaller icon like the facebook's icon? I used different pixels, but my application was redemensioning them, and it's a little too big, I want my icons a little bit smaller.

Thanks a lot !!!

L.E: Here is my:

activity_main_drawer.xml

<android.support.v4.widget.DrawerLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

    <!-- The main content view -->

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context=".MainActivity"
        android:background="@drawable/front" >

        <Button
            android:id="@+id/buttonmp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true" />


    </RelativeLayout>

    <!-- The navigation drawer -->

    <ListView
        android:id="@+id/drawer"
        android:layout_width="300dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@drawable/slidingm"
        android:choiceMode="singleChoice"
        android:divider="@android:color/black"
        android:dividerHeight="0dp"
        android:textColor="@android:color/white"
         />

</android.support.v4.widget.DrawerLayout>
Ezekiel
  • 333
  • 4
  • 9
  • 27

1 Answers1

0

If you are new to Android, you will find this a little difficult: you have to add headings on your ListView.

You can do this by creating your ListAdapter to return heading rows as well as detail rows. In order to do so, you must override methods like getViewTypeCount() and getItemViewType() in your ListAdapter and getView() must know the difference between the row types. When your getView() find the heading row, you can edit the height of this row and obtain the result showed in your question.

This link contains 2 answers that I find useful.

Community
  • 1
  • 1
JJ86
  • 5,055
  • 2
  • 35
  • 64