直接for>childCount,設(shè)置layout>重置left,判斷下一個child的寬+left是否大于getWidth(),if(i+1<cCount){top= top+lp.XX+child.width;left = getpadingleft;}
這樣好像簡單啊
這樣好像簡單啊
2015-12-12
最新回答 / 用戶1078541
系統(tǒng)源碼就是這么調(diào)用的。在View類里面,?public View(Context context, AttributeSet attrs) {? ? ? ? this(context, attrs, 0);? ? }第二個參數(shù)的構(gòu)造直接調(diào)用第三個參數(shù)的構(gòu)造。defstyle傳遞0.
2015-11-01
最新回答 / 奮_斗
private void ChangeView()??? {??????? ly.removeAllViews();??????? LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);??????? View layout = inflater.inflate(R.layout.grid,null);??????? GridView gridview = (GridView)layout.f...
2015-08-13
已采納回答 / 用戶1078541
public void initData() { LayoutInflater mInflater = LayoutInflater.from(this); for (int i = 0; i < mVals.length; i++) { final int position = i; final TextView tv = (TextView) mInflater.inflate(R.layout.tv, mFlowLayout, false); tv.setText(m...
2015-08-07