import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
* Created by wanqi on 15-7-20.
*/
public class ScrollListView extends ListView {

public ScrollListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//根据模式计算每个child的高度和宽度
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}

       在xml文件中应用 ;

  <com.cs.ronghui.list.MyListView                
android: />

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-05-13
  • 2022-12-23
  • 2021-08-30
相关资源
相似解决方案