?
本文檔使用 PHP中文網(wǎng)手冊(cè) 發(fā)布
TableLayout.LayoutParams
版本:Android 3.0 r1
?
結(jié)構(gòu)
繼承關(guān)系
public static class TableLayout.LayoutParams extends LinerLayout.LayoutParams
????????
java.lang.Object
???????? android.view.ViewGroup.LayoutParams
? ????????????? android.view.ViewGroup.MarginLayoutParams
? ???? ??????????????? android.widget.LinearLayout.LayoutParams
? ???? ?????? ??????????????? android.widget.TableLayout.LayoutParams
?
概述
???????? 這種布局參數(shù)強(qiáng)制每個(gè)子元素的寬度為MATCH_PARENT
和
每個(gè)子元素的高度為WRAP_CONTENT
,但只有在未指定高度的情況下。
?
構(gòu)造函數(shù)
???????? public TableLayout.LayoutParams (Context c, AttributeSet attrs)
?
public TableLayout.LayoutParams (int w, int h)
?
public TableLayout.LayoutParams (int w, int h, float initWeight)
?
public TableLayout.LayoutParams ()
設(shè)置子元素的寬為ViewGroup.LayoutParams
高為WRAP_CONTENT
。
?
public TableLayout.LayoutParams (ViewGroup.LayoutParams p)
?
public TableLayout.LayoutParams (ViewGroup.MarginLayoutParams source)
?
公共方法
protected void setBaseAttributes (TypedArray a, int widthAttr, int heightAttr)
修改行寬度的參數(shù)為MATCH_PARENT
;
行高度的布局參數(shù)如果沒有指定則修改為WRAP_CONTENT
。
參數(shù)
a ???? 一組樣式屬性
widthAttr ?????? 獲取的寬度屬性
heightAttr ????? 獲取的高度屬性