How to add a footer in ListView?

前端 未结 7 1720
时光取名叫无心
时光取名叫无心 2020-11-22 09:35

I am developing an application,In my application,I am using Listview for displaying data using dom parsing,I want to footer in listview,when i click footer additional more d

7条回答
  •  自闭症患者
    2020-11-22 10:08

    The activity in which you want to add listview footer and i have also generate an event on listview footer click.

      public class MainActivity extends Activity
    {
    
            @Override
            protected void onCreate(Bundle savedInstanceState)
             {
    
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);
    
                ListView  list_of_f = (ListView) findViewById(R.id.list_of_f);
    
                LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
                View view = inflater.inflate(R.layout.web_view, null);  // i have open a webview on the listview footer
    
                RelativeLayout  layoutFooter = (RelativeLayout) view.findViewById(R.id.layoutFooter);
    
                list_of_f.addFooterView(view);
    
            }
    
    }
    

    activity_main.xml

    
    
    
        
    
        
        
    
    
    

提交回复
热议问题