自己创建listview
来源:互联网 发布:冯巩演技 知乎 编辑:程序博客网 时间:2024/06/01 10:18
public class MyListView extends ListView {
public MyListView(Context context) {
super(context);
}
public MyListView(Context context) {
super(context);
}
public MyListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
super(context, attrs);
}
public MyListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
super(context, attrs, defStyleAttr);
}
/**
* 重新计算高度
* @param widthMeasureSpec
* @param heightMeasureSpec
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
* 重新计算高度
* @param widthMeasureSpec
* @param heightMeasureSpec
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
阅读全文
0 1
- 自己创建listview
- ArrayAdapter和自己创建BaseAdapter用于ListView的示例
- listview 操作-创建 listview
- android中,用SimpleAdapter创建有自己布局的listView,以及listView的修改更新notifyDataSetChanged()的使用。
- //创建自己
- 建立自己的ListView
- 创建ListView步骤
- 为ListView创建ContextMenu
- 为ListView创建ContextMenu
- 使用SimpleAdapter创建ListView
- ListView-使用SimpleAdapter创建
- ListView 创建及使用
- 使用SimpleAdapter创建ListView
- BaseAdapter 创建ListView实例
- lua 创建listview
- ArrayAdapter创建ListView
- SimpleAdapter创建ListView
- ListView上下文菜单创建
- 第二章 Nginx服务器的安装部署【下】
- noip/信息技术选考 进制转化
- 计蒜客————无脑博士的试管们
- js的闭包
- leetcode 181. Employees Earning More Than Their Managers(SQL,相关子查询,自身连接)38
- 自己创建listview
- ROS小白碰壁记之三 EAI雷达F4的使用
- 大小写字母间转换
- 【小组会整理】ICLR2016Particular object retrieval with integral max-pooling of CNN activations
- LeetCode WIith JS || 121. Best Time to Buy and Sell Stock[求股票的最佳收益,只能交易一次]
- 矩阵乘法
- Spring Boot(六):如何配置静态资源的地址与访问路径
- java集合之Collection---set/map/list
- 设计模式(8)