java.lang.Object | |||||
android.view.View | Drawable.Callback KeyEvent.Callback | ||||
android.view.ViewGroup | ViewManager ViewParent | ||||
android.widget.LinearLayout | |||||
android.widget.TableRow |
A layout that arranges its children horizontally. A TableRow should always be used as a child of a TableLayout. If a TableRow's parent is not a TableLayout, the TableRow will behave as an horizontal LinearLayout.
The children of a TableRow do not need to specify the
layout_width
and layout_height
attributes in the
XML file. TableRow always enforces those values to be respectively
FILL_PARENT and
WRAP_CONTENT.
Also see android.widget.TableRow.LayoutParams for layout attributes
TableRow.LayoutParams | Set of layout parameters used in table rows. |
TableRow(Context context) | ||||||
Creates a new TableRow for the given context. |
||||||
TableRow(Context context, AttributeSet attrs) | ||||||
Creates a new TableRow for the given context and with the specified set attributes. |
TableRow.LayoutParams | generateLayoutParams(AttributeSet attrs) | |||||
Returns a new set of layout parameters based on the supplied attributes set. | ||||||
View | getVirtualChildAt(int i) | |||||
Returns the view at the specified index. |
||||||
int | getVirtualChildCount() | |||||
Returns the virtual number of children. |
||||||
void | setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener listener) | |||||
Register a callback to be invoked when a child is added to or removed from this view. |
boolean | checkLayoutParams(ViewGroup.LayoutParams p) | |||||
LinearLayout.LayoutParams | generateDefaultLayoutParams() | |||||
Returns a set of layout parameters with a width of FILL_PARENT, a height of WRAP_CONTENT and no spanning. | ||||||
LinearLayout.LayoutParams | generateLayoutParams(ViewGroup.LayoutParams p) | |||||
Returns a safe set of layout parameters based on the supplied layout params. | ||||||
void | onLayout(boolean changed, int l, int t, int r, int b) | |||||
Called from layout when this view should assign a size and position to each of its children. | ||||||
void | onMeasure(int widthMeasureSpec, int heightMeasureSpec) | |||||
Measure the view and its content to determine the measured width and the measured height. |
Creates a new TableRow for the given context.
context | the application environment |
---|
Creates a new TableRow for the given context and with the specified set attributes.
context | the application environment |
---|---|
attrs | a collection of attributes |
attrs | the attributes to build the layout parameters from |
---|
Returns the view at the specified index. This method can be overriden to take into account virtual children. Refer to TableLayout and TableRow for an example.
i | the child's index |
---|
Returns the virtual number of children. This number might be different than the actual number of children if the layout can hold virtual children. Refer to TableLayout and TableRow for an example.
listener | the callback to invoke on hierarchy change |
---|
p | The layout parameters to convert into a suitable set of layout parameters for this ViewGroup. |
---|
changed | This is a new size or position for this view |
---|---|
l | Left position, relative to parent |
t | Top position, relative to parent |
r | Right position, relative to parent |
b | Bottom position, relative to parent |
Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents.
CONTRACT: When overriding this method, you
must call setMeasuredDimension(int, int) to store the
measured width and height of this view. Failure to do so will trigger an
IllegalStateException
, thrown by
measure(int, int). Calling the superclass'
onMeasure(int, int) is a valid use.
The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override onMeasure(int, int) to provide better measurements of their content.
If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the view's minimum height and width (getSuggestedMinimumHeight() and getSuggestedMinimumWidth()).
widthMeasureSpec | horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec. |
---|---|
heightMeasureSpec | vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec. |
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:56 |