回覆列表
  • 1 # 知識時刻

    1.ScrollView+listView配合著用

    2.動態根據listView中item的高度計算listView的高度:

    public void setHeight(){

    int listViewHeight = 0;

    int adaptCount = comAdapter.getCount();

    for(int i=0;i<adaptCount;i++){

    View temp = comAdapter.getView(i,null,lsComment);

    temp.measure(0,0);

    listViewHeight += temp.getMeasuredHeight();

    }

    LayoutParams layoutParams = this.lsComment.getLayoutParams();

    layoutParams.width = LayoutParams.FILL_PARENT;

    layoutParams.height = listViewHeight;

    lsComment.setLayoutParams(layoutParams);

    }

  • 中秋節和大豐收的關聯?
  • 桔子樹怎麼種?