English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.TableRow

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

Nested Classes
TableRow.LayoutParams

This set of layout parameters enforces the width of each child to be FILL_PARENT and the height of each child to be WRAP_CONTENT

Summary

XML Attributes inherited from class android.widget.LinearLayout
XML Attributes inherited from class android.view.ViewGroup
XML Attributes inherited from class android.view.View
Constants inherited from class android.widget.LinearLayout
Constants inherited from class android.view.ViewGroup
Constants inherited from class android.view.View
Fields inherited from class android.widget.LinearLayout
Fields inherited from class android.view.ViewGroup
Fields inherited from class android.view.View

Public Constructors

          TableRow(Context context)

Creates a new TableRow for the given context.

          TableRow(Context context, AttributeSet attrs, Map inflateParams)

Creates a new TableRow for the given context and with the specified set attributes.

Public Methods

        void  addView(View child)

Adds a view to this table row using the view's existing layout parameters.

        LayoutParams  generateLayoutParams(AttributeSet attrs)
        View  getVirtualChildAt(int i)

Returns the view at the specified index.

        int  getVirtualChildCount()

Returns the virtual number of children.

        void  setOnHierarchyChangeListener(OnHierarchyChangeListener listener)
Register a callback to be invoked when a child is added to or removed from this view.

Protected Methods

        boolean  checkLayoutParams(LayoutParams p)
        int  getChildrenSkipCount(View child, int index)

Returns the number of children to skip after measuring/laying out the specified child.

        int  getLocationOffset(View child)

Return the location offset of the specified child.

        int  getNextLocationOffset(View child)

Return the size offset of the next sibling of the specified child.

        void  measureChildBeforeLayout(View child, int childIndex, int widthMeasureSpec, int totalWidth, int heightMeasureSpec, int totalHeight)

Measure the child according to the parent's measure specs.

        int  measureNullChild(int childIndex)

Returns the size (width or height) that should be occupied by a null child.

        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.

Methods inherited from class android.widget.LinearLayout
Methods inherited from class android.view.ViewGroup