public class LayoutAlignment extends Object
This class controls the alignment of a component with its parent component, for example, vertically centered or horizontally left-aligned.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
BOTTOM |
Indicates the bottom alignment for the component.
|
static int |
CENTER |
Indicates the centered alignment for the component.
|
static int |
END |
Indicates that the component is placed at the end edge in the X axis of the container.
|
static int |
FILL |
Indicates vertical and horizontal fill alignment mode for the component.
|
static int |
HORIZONTAL_CENTER |
Indicates the horizontally centered alignment for the component.
|
static int |
HORIZONTAL_LAYOUT_ALIGNMENT_MASK |
Indicates a binary mask used to obtain a horizontal alignment type.
|
static int |
LEFT |
Indicates the left alignment for the component.
|
static int |
RIGHT |
Indicates the right alignment for the component.
|
static int |
START |
Indicates that the component is placed at the start edge in the X axis of the container.
|
static int |
TOP |
Indicates the top alignment for the component.
|
static int |
UNSET |
Indicates that no alignment is set for the component.
|
static int |
VERTICAL_CENTER |
Indicates the vertically centered alignment for the component.
|
static int |
VERTICAL_LAYOUT_ALIGNMENT_MASK |
Indicates a binary mask used to obtain a vertical alignment type.
|
static int |
X_AXIS_CROP |
Indicates horizontal crop alignment mode for the component.
|
static int |
X_AXIS_FILL |
Indicates horizontal fill alignment mode for the component.
|
static int |
Y_AXIS_CROP |
Indicates vertical crop alignment mode for the component.
|
static int |
Y_AXIS_FILL |
Indicates vertical fill alignment mode for the component.
|
| 构造器 | 说明 |
|---|---|
LayoutAlignment() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static boolean |
hasHorizontalAlignment(int layoutAlignment) |
Checks whether a given alignment type contains one of the following horizontal alignment modes:
LEFT,
RIGHT, HORIZONTAL_CENTER, START, END, and CENTER. |
static boolean |
hasVerticalAlignment(int layoutAlignment) |
Checks whether a given alignment type contains one of the following vertical alignment modes:
TOP,
BOTTOM, VERTICAL_CENTER, and CENTER. |
public static final int BOTTOM
public static final int CENTER
public static final int END
public static final int FILL
public static final int HORIZONTAL_CENTER
public static final int HORIZONTAL_LAYOUT_ALIGNMENT_MASK
public static final int LEFT
public static final int RIGHT
public static final int START
public static final int TOP
public static final int UNSET
public static final int VERTICAL_CENTER
public static final int VERTICAL_LAYOUT_ALIGNMENT_MASK
public static final int X_AXIS_CROP
Works only for images that width greater than its container.
public static final int X_AXIS_FILL
public static final int Y_AXIS_CROP
Works only for images that height greater than its container.
public static final int Y_AXIS_FILL
public static boolean hasVerticalAlignment(int layoutAlignment)
TOP,
BOTTOM, VERTICAL_CENTER, and CENTER.layoutAlignment - Indicates the given alignment type.true if the given alignment type contains a vertical alignment mode;
returns false otherwise.public static boolean hasHorizontalAlignment(int layoutAlignment)
LEFT,
RIGHT, HORIZONTAL_CENTER, START, END, and CENTER.layoutAlignment - Indicates the given alignment type.true if the given alignment type contains a horizontal alignment mode;
returns false otherwise.