Translated from:Http://developer.android.com/reference/android/view/View.MeasureSpec.html
Inheritance relationship
Java. Lang. Object
| _____ Android. View. View. measurespec
Class Overview
The measurespec class encapsulates the layout requirements that are passed from the parent container to the Child view. Each measurespec object represents a width and/or height requirement, which consists of a size and a mode. The mode is as follows:
Unspecified
The parent container does not impose any constraints on the Child view. It can be any size it wants.
Exactly
The parent container determines the exact size of the Child view. Subviews are given their boundaries, regardless of the actual size of the view.
At_most
The size of a child view can be as large as the size specified by the Child view. This class provides a method to compress <size, mode> and decompress it into integers.
Constants |
Int |
At_most |
Measurement specification mode: The child view can be as large as the size specified by it. |
Int |
Exactly |
Measurement specification mode: the parent container determines the precise size of the Child view. |
Int |
Unspecified |
Measurement specification mode: the parent container does not forcibly restrict the size of the Child view. |
Public Constructors |
|
View. measurespec() |
Public Methods |
| static int |
getmode (INT measurespec) extract measurement modes from the provided measurement specifications. parameter measurespec: Measure specifications to extract measurement modes return value unspecified, at_most or exactly |
| static int |
getsize (INT measurespec) extract dimensions from provided measurement specifications parameter measurespec to extract measurement specifications for measurement dimensions return value dimensions defined in pixels in the provided measurement specifications. |
| static int |
makemeasurespec (INT size, int Mode) creates a measurement specification based on the specified size and mode. The mode must be one of the following values: unspecified exactly at_most parameter siz E measurement specification size mode: standard mode return value A measurement specification based on the specified size and mode. |
Static string |
Tostring (INT measurespec) Returns the string representation of the specified measurement specification. Parameters Measure specification for converting measurespec to a string Return Value A string in the format of "measurespec: mode size. |