How to add title in Navigation drawer layout?

后端 未结 3 1614
清酒与你
清酒与你 2020-12-23 10:20

[UPDATE]

I solve the problem by adding addHeaderView :

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
          


        
3条回答
  •  被撕碎了的回忆
    2020-12-23 11:02

    You would do that the same way as you would add headings in any other ListView, by teaching your ListAdapter to return heading rows as well as detail rows. At the low level, this involves overriding methods like getViewTypeCount() and getItemViewType() in your ListAdapter, plus having getView() know the difference between the row types. Or, use an existing high-level implementation like https://github.com/emilsjolander/StickyListHeaders or http://code.google.com/p/android-amazing-listview/ or any of the others found when searching for android listview headers.

提交回复
热议问题