# ViewGroup.LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[XML Attrs](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#lattrs)\|[Constants](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#constants)\|[Fields](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#lfields)\|[Ctors](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#pubctors)\|[Methods](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#inhmethods)  

# ViewGroup.LayoutParams

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams "View this page in Kotlin")\|Java

`
public
static


class
ViewGroup.LayoutParams
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.ViewGroup.LayoutParams |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [AbsListView.LayoutParams](https://developer.android.com/reference/android/widget/AbsListView.LayoutParams),[AbsoluteLayout.LayoutParams](https://developer.android.com/reference/android/widget/AbsoluteLayout.LayoutParams),[Gallery.LayoutParams](https://developer.android.com/reference/android/widget/Gallery.LayoutParams),[ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams),[WindowManager.LayoutParams](https://developer.android.com/reference/android/view/WindowManager.LayoutParams) |-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| | [AbsListView.LayoutParams](https://developer.android.com/reference/android/widget/AbsListView.LayoutParams)       | AbsListView extends LayoutParams to provide a place to hold the view type.                                                                   | | [AbsoluteLayout.LayoutParams](https://developer.android.com/reference/android/widget/AbsoluteLayout.LayoutParams) | Per-child layout information associated with AbsoluteLayout.                                                                                 | | [Gallery.LayoutParams](https://developer.android.com/reference/android/widget/Gallery.LayoutParams)               | Gallery extends LayoutParams to provide a place to hold current Transformation information along with previous position/transformation info. | | [ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams) | Per-child layout information for layouts that support margins.                                                                               | | [WindowManager.LayoutParams](https://developer.android.com/reference/android/view/WindowManager.LayoutParams)     |                                                                                                                                              | |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [ActionBar.LayoutParams](https://developer.android.com/reference/android/app/ActionBar.LayoutParams),[ActionMenuView.LayoutParams](https://developer.android.com/reference/android/widget/ActionMenuView.LayoutParams),[FrameLayout.LayoutParams](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams),[GridLayout.LayoutParams](https://developer.android.com/reference/android/widget/GridLayout.LayoutParams),[LinearLayout.LayoutParams](https://developer.android.com/reference/android/widget/LinearLayout.LayoutParams),[RadioGroup.LayoutParams](https://developer.android.com/reference/android/widget/RadioGroup.LayoutParams),[RelativeLayout.LayoutParams](https://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams),[TableLayout.LayoutParams](https://developer.android.com/reference/android/widget/TableLayout.LayoutParams),[TableRow.LayoutParams](https://developer.android.com/reference/android/widget/TableRow.LayoutParams),[Toolbar.LayoutParams](https://developer.android.com/reference/android/widget/Toolbar.LayoutParams) |-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ActionBar.LayoutParams](https://developer.android.com/reference/android/app/ActionBar.LayoutParams)              | Per-child layout information associated with action bar custom views.                                                                                                                                                                                                                                                                                                                                          | | [ActionMenuView.LayoutParams](https://developer.android.com/reference/android/widget/ActionMenuView.LayoutParams) |                                                                                                                                                                                                                                                                                                                                                                                                                | | [FrameLayout.LayoutParams](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams)       | Per-child layout information for layouts that support margins.                                                                                                                                                                                                                                                                                                                                                 | | [GridLayout.LayoutParams](https://developer.android.com/reference/android/widget/GridLayout.LayoutParams)         | Layout information associated with each of the children of a GridLayout.                                                                                                                                                                                                                                                                                                                                       | | [LinearLayout.LayoutParams](https://developer.android.com/reference/android/widget/LinearLayout.LayoutParams)     | Per-child layout information associated with ViewLinearLayout.                                                                                                                                                                                                                                                                                                                                                 | | [RadioGroup.LayoutParams](https://developer.android.com/reference/android/widget/RadioGroup.LayoutParams)         | This set of layout parameters defaults the width and the height of the children to[ViewGroup.LayoutParams.WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT)when they are not specified in the XML file.                                                                                                                                                  | | [RelativeLayout.LayoutParams](https://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams) | Specifies how a view is positioned within a[RelativeLayout](https://developer.android.com/reference/android/widget/RelativeLayout).                                                                                                                                                                                                                                                                            | | [TableLayout.LayoutParams](https://developer.android.com/reference/android/widget/TableLayout.LayoutParams)       | This set of layout parameters enforces the width of each child to be[ViewGroup.LayoutParams.MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT)and the height of each child to be[ViewGroup.LayoutParams.WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT), but only if the height is not specified. | | [TableRow.LayoutParams](https://developer.android.com/reference/android/widget/TableRow.LayoutParams)             | Set of layout parameters used in table rows.                                                                                                                                                                                                                                                                                                                                                                   | | [Toolbar.LayoutParams](https://developer.android.com/reference/android/widget/Toolbar.LayoutParams)               | Layout information for child views of Toolbars.                                                                                                                                                                                                                                                                                                                                                                | |

<br />

*** ** * ** ***

LayoutParams are used by views to tell their parents how they want to be laid out. See[ViewGroup Layout Attributes](https://developer.android.com/reference/android/R.styleable#ViewGroup_Layout)for a list of all child view attributes that this class supports.

The base LayoutParams class just describes how big the view wants to be for both width and height. For each dimension, it can specify one of:

- FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)
- WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)
- an exact number

There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value.

<br />

### Developer Guides

For more information about creating user interface layouts, read the[XML Layouts](https://developer.android.com/guide/topics/ui/declaring-layout)developer guide.

<br />

## Summary

|                                                                             ### XML attributes                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| [`android:layout_height`](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#attr_android:layout_height) | Specifies the basic height of the view. |
| [`android:layout_width`](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#attr_android:layout_width)   | Specifies the basic width of the view.  |

|                                                                               ### Constants                                                                                ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT) Special value for the height or width requested by a View.   |
| `int` | [MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT) Special value for the height or width requested by a View. |
| `int` | [WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT) Special value for the height or width requested by a View. |

|                                                                                                                                                              ### Fields                                                                                                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public int`                                                                                                                                                           | [height](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#height) Information about how tall the view wants to be.               |
| ` public `[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters) | [layoutAnimationParameters](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#layoutAnimationParameters) Used to animate layouts. |
| ` public int`                                                                                                                                                           | [width](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#width) Information about how wide the view wants to be.                 |

|                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                   ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#LayoutParams(android.content.Context,%20android.util.AttributeSet))`(`[Context](https://developer.android.com/reference/android/content/Context)` c, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet)` attrs) ` Creates a new set of layout parameters. |
| ` `[LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#LayoutParams(android.view.ViewGroup.LayoutParams))`(`[ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams)` source) ` Copy constructor.                                                                                                   |
| ` `[LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#LayoutParams(int,%20int))`(int width, int height) ` Creates a new set of layout parameters with the specified width and height.                                                                                                                                                           |

|                                                                                                         ### Public methods                                                                                                         ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[resolveLayoutDirection](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#resolveLayoutDirection(int))`(int layoutDirection) ` Resolve layout parameters depending on the layout direction. |

|                                                                                                                                                                         ### Protected methods                                                                                                                                                                         ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[setBaseAttributes](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#setBaseAttributes(android.content.res.TypedArray,%20int,%20int))`(`[TypedArray](https://developer.android.com/reference/android/content/res/TypedArray)` a, int widthAttr, int heightAttr) ` Extracts the layout parameters from the supplied attributes. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## XML attributes

### android:layout_height

Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants.

May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Must be one of the following constant values.

|   Constant   |  Value   |                                                                   Description                                                                    |
|--------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| fill_parent  | ffffffff | The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by`match_parent`. |
| match_parent | ffffffff | The view should be as big as its parent (minus padding). Introduced in API Level 8.                                                              |
| wrap_content | fffffffe | The view should be only big enough to enclose its content (plus padding).                                                                        |

<br />

<br />

### android:layout_width

Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants.

May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Must be one of the following constant values.

|   Constant   |  Value   |                                                                   Description                                                                    |
|--------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| fill_parent  | ffffffff | The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by`match_parent`. |
| match_parent | ffffffff | The view should be as big as its parent (minus padding). Introduced in API Level 8.                                                              |
| wrap_content | fffffffe | The view should be only big enough to enclose its content (plus padding).                                                                        |

<br />

<br />

## Constants

### FILL_PARENT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FILL_PARENT
```

Special value for the height or width requested by a View. FILL_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. This value is deprecated starting in API Level 8 and replaced by[MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT).

<br />

Constant Value: -1 (0xffffffff)  

### MATCH_PARENT

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_PARENT
```

Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8.

<br />

Constant Value: -1 (0xffffffff)  

### WRAP_CONTENT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int WRAP_CONTENT
```

Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.

<br />

Constant Value: -2 (0xfffffffe)

## Fields

### height

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int height
```

Information about how tall the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT in API Level 8) or WRAP_CONTENT, or an exact size.

<br />

### layoutAnimationParameters

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutAnimationController.AnimationParameters layoutAnimationParameters
```

Used to animate layouts.

<br />

### width

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int width
```

Information about how wide the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT in API Level 8) or WRAP_CONTENT, or an exact size.

<br />

## Public constructors

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutParams (Context c, 
                AttributeSet attrs)
```

Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context. The XML attributes mapped to this set of layout parameters are:

- `layout_width`: the width, either an exact value,[WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT), or[FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT)(replaced by[MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT)in API Level 8)
- `layout_height`: the height, either an exact value,[WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT), or[FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT)(replaced by[MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT)in API Level 8)

<br />

<br />

|                                                Parameters                                                 ||
|---------|--------------------------------------------------------------------------------------------------|
| `c`     | `Context`: the application environment <br />                                                    |
| `attrs` | `AttributeSet`: the set of attributes from which to extract the layout parameters' values <br /> |

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutParams (ViewGroup.LayoutParams source)
```

Copy constructor. Clones the width and height values of the source.

<br />

|                                 Parameters                                 ||
|----------|------------------------------------------------------------------|
| `source` | `ViewGroup.LayoutParams`: The layout params to copy from. <br /> |

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutParams (int width, 
                int height)
```

Creates a new set of layout parameters with the specified width and height.

<br />

|                                                                                                                                                                                                       Parameters                                                                                                                                                                                                        ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `width`  | `int`: the width, either[WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT),[FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT)(replaced by[MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT)in API Level 8), or a fixed size in pixels <br />  |
| `height` | `int`: the height, either[WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT),[FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT)(replaced by[MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT)in API Level 8), or a fixed size in pixels <br /> |

## Public methods

### resolveLayoutDirection

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void resolveLayoutDirection (int layoutDirection)
```

Resolve layout parameters depending on the layout direction. Subclasses that care about layoutDirection changes should override this method. The default implementation does nothing.

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `layoutDirection` | `int`: the direction of the layout[View.LAYOUT_DIRECTION_LTR](https://developer.android.com/reference/android/view/View#LAYOUT_DIRECTION_LTR)[View.LAYOUT_DIRECTION_RTL](https://developer.android.com/reference/android/view/View#LAYOUT_DIRECTION_RTL) <br /> |

## Protected methods

### setBaseAttributes

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected void setBaseAttributes (TypedArray a, 
                int widthAttr, 
                int heightAttr)
```

Extracts the layout parameters from the supplied attributes.

<br />

|                                       Parameters                                       ||
|--------------|--------------------------------------------------------------------------|
| `a`          | `TypedArray`: the style attributes to extract the parameters from <br /> |
| `widthAttr`  | `int`: the identifier of the width attribute <br />                      |
| `heightAttr` | `int`: the identifier of the height attribute <br />                     |