1

I am trying to make a navigationDrawer in Android v4.0+ to be exactly like in this example in the official documentation of android.

However I do not find any documentation how to achieve this. All I can find is telling me to extend the ListView, but that just sounds weird as it looks like the native android classes should have this kind of functionality.

Laurynas Mališauskas
  • 1,909
  • 1
  • 19
  • 34

1 Answers1

1

I think you are looking for "ListView header items". One way to achieve such layout is to let your (custom) adapter know that the items at specific positions (or some other criteria) have to be displayed with different layout and populate a different view for those items in it's getView method.

stan0
  • 11,549
  • 6
  • 42
  • 59
  • do you have an example of how this could be achieved? If i understand correctly, i should add Custom class objects from which properties adapter would know which View it has to return? – Laurynas Mališauskas Jan 30 '14 at 12:11
  • 1
    Try this: http://stackoverflow.com/questions/13590627/android-listview-headers It looks like it's well explained. If you find it not suitable, search for "android listview header" and see what other solutions might exist – stan0 Jan 30 '14 at 14:30