Android : How to avoid header from scrolling in listview , android?

前端 未结 5 2092
攒了一身酷
攒了一身酷 2021-01-02 08:37

I have a list view , where i am adding headerview to that list . every thing fine , but when am scrolling list headerview also moving with list, so i want to avoid headervie

5条回答
  •  -上瘾入骨i
    2021-01-02 09:15

    Instead of a header use the following layout:

    
        
          --> Your header layout here           
        
    
       
    
    

    Important things to notice:

    • The id of the ListView must be @android:id/list in order to be able to use a ListActivity
    • Use a 0 height and set the weight to 1

提交回复
热议问题