Android: Adding static header to the top of a ListActivity

前端 未结 5 823
别那么骄傲
别那么骄傲 2020-11-28 23:07

Currently I have a class that is extending the ListActivity class. I need to be able to add a few static buttons above the list that are always visible. I\'ve attempted to

5条回答
  •  生来不讨喜
    2020-11-28 23:27

    After some research I was able to figure out that mixing TableLayout and LinearLayout within my ListActivity XML document I was able to add a header to the document. Below is my XML document if anyone is interested to see it. While synic's approach is probably the right approach after work with his solution for sometime I was unable to make it function the way I wanted it.

    AuditTab.java

    public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.audittab);
            getListView().setEmptyView(findViewById(R.id.empty));
    }
    

    audittab.xml

    
    
        
            
                

    AuditItem.xml

    
    
        
        
        
        
    
        
        
        
        
        
        
        
        
        
        
        

提交回复
热议问题