Android ListView with fixed header and footer

前端 未结 7 913
半阙折子戏
半阙折子戏 2020-12-30 07:14

How can I create a ListView with fixed header and footer?

I don\'t want the header/footer to scroll with the items in the ListView.

7条回答
  •  無奈伤痛
    2020-12-30 07:45

    http://developer.android.com/reference/android/widget/ListView.html#addHeaderView%28android.view.View%29. Check this for addHeaderView(param).

    http://developer.android.com/reference/android/widget/ListView.html#addFooterView%28android.view.View%29. Check this for addFooterView(param).

    Example of the method usuage by inlfating a layout @ Android listview with header and footer buttons

    You can use addHeaderView and addFooterView for the list to add header and footer.

    You can do as what @blackbelt suggested. I have used a relative layout instead of LinearLayout.

    
    
    
    
    
    
    
    
    
    

    Graphical Layout snap shot

    enter image description here

提交回复
热议问题