Build 1.0_r1(from source)

Class ViewGroup.MarginLayoutParams

  extended by android.view.ViewGroup.LayoutParams
      extended by android.view.ViewGroup.MarginLayoutParams
Direct Known Subclasses:
FrameLayout.LayoutParams, LinearLayout.LayoutParams, RelativeLayout.LayoutParams
Enclosing class:

public static class ViewGroup.MarginLayoutParams
extends ViewGroup.LayoutParams

Per-child layout information for layouts that support margins. See ViewGroup Margin Layout Attributes for a list of all child view attributes that this class supports.

Field Summary
 int bottomMargin
          The bottom margin in pixels of the child.
 int leftMargin
          The left margin in pixels of the child.
 int rightMargin
          The right margin in pixels of the child.
 int topMargin
          The top margin in pixels of the child.
Fields inherited from class android.view.ViewGroup.LayoutParams
FILL_PARENT, height, layoutAnimationParameters, width, WRAP_CONTENT
Constructor Summary
ViewGroup.MarginLayoutParams(Context c, AttributeSet attrs)
          Creates a new set of layout parameters.
ViewGroup.MarginLayoutParams(int width, int height)
ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams source)
ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams source)
          Copy constructor.
Method Summary
 void setMargins(int left, int top, int right, int bottom)
          Sets the margins, in pixels.
Methods inherited from class android.view.ViewGroup.LayoutParams
debug, setBaseAttributes, sizeToString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public int leftMargin
The left margin in pixels of the child.


public int topMargin
The top margin in pixels of the child.


public int rightMargin
The right margin in pixels of the child.


public int bottomMargin
The bottom margin in pixels of the child.

Constructor Detail


public ViewGroup.MarginLayoutParams(Context c,
                                    AttributeSet attrs)
Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context.

c - the application environment
attrs - the set of attributes from which to extract the layout parameters' values


public ViewGroup.MarginLayoutParams(int width,
                                    int height)


public ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams source)
Copy constructor. Clones the width, height and margin values of the source.

source - The layout params to copy from.


public ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams source)

Method Detail


public void setMargins(int left,
                       int top,
                       int right,
                       int bottom)
Sets the margins, in pixels.

left - the left margin size
top - the top margin size
right - the right margin size
bottom - the bottom margin size

Build 1.0_r1(from source)

Please submit a feedback, bug or feature