public static class ViewGroup.LayoutParams extends Object
ViewGroup Layout Attributes
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:
For more information about creating user interface layouts, read the XML Layouts developer guide.
Modifier and Type | Field and Description |
---|---|
static int |
FILL_PARENT
Deprecated.
|
int |
height
Information about how tall the view wants to be.
|
LayoutAnimationController.AnimationParameters |
layoutAnimationParameters
Used to animate layouts.
|
static int |
MATCH_PARENT
Special value for the height or width requested by a View.
|
int |
width
Information about how wide the view wants to be.
|
static int |
WRAP_CONTENT
Special value for the height or width requested by a View.
|
Constructor and Description |
---|
ViewGroup.LayoutParams(Context c,
AttributeSet attrs)
Creates a new set of layout parameters.
|
ViewGroup.LayoutParams(int width,
int height)
Creates a new set of layout parameters with the specified width
and height.
|
ViewGroup.LayoutParams(ViewGroup.LayoutParams source)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
debug(String output)
Returns a String representation of this set of layout parameters.
|
void |
onDebugDraw(View view,
Canvas canvas)
Use
canvas to draw suitable debugging annotations for these LayoutParameters. |
void |
resolveLayoutDirection(int layoutDirection)
Resolve layout parameters depending on the layout direction.
|
protected void |
setBaseAttributes(TypedArray a,
int widthAttr,
int heightAttr)
Extracts the layout parameters from the supplied attributes.
|
protected static String |
sizeToString(int size)
Converts the specified size to a readable String.
|
@Deprecated public static final int FILL_PARENT
MATCH_PARENT
.public static final int MATCH_PARENT
public static final int WRAP_CONTENT
public int width
public int height
public LayoutAnimationController.AnimationParameters layoutAnimationParameters
public ViewGroup.LayoutParams(Context c, AttributeSet attrs)
layout_width
: the width, either an exact value,
WRAP_CONTENT
, or FILL_PARENT
(replaced by
MATCH_PARENT
in API Level 8)layout_height
: the height, either an exact value,
WRAP_CONTENT
, or FILL_PARENT
(replaced by
MATCH_PARENT
in API Level 8)c
- the application environmentattrs
- the set of attributes from which to extract the layout
parameters' valuespublic ViewGroup.LayoutParams(int width, int height)
width
- the width, either WRAP_CONTENT
,
FILL_PARENT
(replaced by MATCH_PARENT
in
API Level 8), or a fixed size in pixelsheight
- the height, either WRAP_CONTENT
,
FILL_PARENT
(replaced by MATCH_PARENT
in
API Level 8), or a fixed size in pixelspublic ViewGroup.LayoutParams(ViewGroup.LayoutParams source)
source
- The layout params to copy from.protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr)
a
- the style attributes to extract the parameters fromwidthAttr
- the identifier of the width attributeheightAttr
- the identifier of the height attributepublic void resolveLayoutDirection(int layoutDirection)
layoutDirection
- the direction of the layout
View.LAYOUT_DIRECTION_LTR
View.LAYOUT_DIRECTION_RTL
public String debug(String output)
output
- the String to prepend to the internal representationpublic void onDebugDraw(View view, Canvas canvas)
canvas
to draw suitable debugging annotations for these LayoutParameters.view
- the view that contains these layout parameterscanvas
- the canvas on which to drawprotected static String sizeToString(int size)
size
- the size to convert