ListView的HeaderView和Footer
2016-04-17 23:44
211 查看
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的上方
----------分割线------------
待更
相关文章推荐
- 继续说一下2016里面的json功能(1)
- JS的事件处理
- ecshop 的密码是什么规则?
- mybatis的sqlsessionFactory
- ERROR 1217 (23000) at line 19: Cannot delete or update a parent row: a foreign key constraint fails
- STM32的时钟树深入详解
- 南京理工大学第八届程序设计大赛 F sequence
- 死锁---同步
- 软工大作业·历物语(一)
- 软工大作业·历物语(一)
- 北京Uber优步司机奖励政策(4月17日)
- 学习笔记(第八周)
- 机电传动控制第八周作业
- OpenGL学习之路(二)
- Xcode中C、C++、Object-C3种语言的混编
- could not initialize proxy - no Session
- JAVA错误:The public type *** must be defined in its own file***
- View的事件体系---V3.3 弹性滑动
- bzoj2743 [HEOI2012]采花
- 总结之H3C汇聚层交换机认证在线人数展示系统