Build 1.0_r1(from source)

android.view
Class ViewGroup.MarginLayoutParams

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

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

leftMargin

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


topMargin

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


rightMargin

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


bottomMargin

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

Constructor Detail

ViewGroup.MarginLayoutParams

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.

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

ViewGroup.MarginLayoutParams

public ViewGroup.MarginLayoutParams(int width,
                                    int height)


ViewGroup.MarginLayoutParams

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

Parameters:
source - The layout params to copy from.

ViewGroup.MarginLayoutParams

public ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams source)

Method Detail

setMargins

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

Parameters:
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