TableLayout.LayoutParams

译者署名: madgoat

译者链接: http://madgoat.cn

版本:Android 3.0 r1

 

结构

继承关系

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

 

概述

         这种布局参数强制每个子元素的宽度为MATCH_PARENT每个子元素的高度为WRAP_CONTENT,但只有在未指定高度的情况下。

 

构造函数

         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 ()

设置子元素的宽为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)

修改行宽度的参数为MATCH_PARENT行高度的布局参数如果没有指定则修改为WRAP_CONTENT

参数

a      一组样式属性

widthAttr        获取的宽度属性

heightAttr       获取的高度属性