zoukankan      html  css  js  c++  java
  • ListView的HeaderView和Footer

    HeaderView介绍

    HeaderView用法

    属性中添加

    ListView中属性listHeader和overScrollHeader区别:

        android:overScrollHeader="@layout/header"
        tools:listheader="@layout/header"
    

    java代码中添加

    listView通过以下方法添加

        listView.addHeaderView(header1);
        listView.addHeaderView(header2, null, false);
    

    其中第二种方法的注释及方法声明如下:

    /**
         * Add a fixed view to appear at the top of the list. If this method is
         * called more than once, the views will appear in the order they were
         * added. Views added using this call can take focus if they want.
         * <p>
         * Note: When first introduced, this method could only be called before
         * setting the adapter with {@link #setAdapter(ListAdapter)}. Starting with
         * {@link android.os.Build.VERSION_CODES#KITKAT}, this method may be
         * called at any time. If the ListView's adapter does not extend
         * {@link HeaderViewListAdapter}, it will be wrapped with a supporting
         * instance of {@link WrapperListAdapter}.
         *
         * @param v The view to add.
         * @param data Data to associate with this view
         * @param isSelectable whether the item is selectable
         */
        public void addHeaderView(View v, Object data, boolean isSelectable) 
    

    headerView的添加有顺序性,即此处header1在header的上方

    ----------分割线------------

    待更

  • 相关阅读:
    Interesting Finds: 2008.06.12
    8月19号
    8月22号
    8月20号
    8月21号
    第七章 Nginx配置虚拟主机
    第六章 Nginx配置文件详解
    第五章 Nginx搭建上传作业平台
    sqlserver2005提供的xml数据类型操作xml串
    事必躬亲利与弊
  • 原文地址:https://www.cnblogs.com/neillee/p/5402858.html
Copyright © 2011-2022 走看看