public class CropElement extends ElementWrapper
Element that crops another Element based on the current rank value.
You can use this class to crop an element.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
CropElement.Orientation |
Enumerates the cropping directions.
|
Element.ConstantState, Element.OnBoundsChangeListener, Element.OnChangeListener, Element.OnLayoutDirectionChangeListener, Element.OnRankChangeListenerALPHA_DEFAULT, ALPHA_MAX, ALPHA_MIN, DEFAULT_BOUNDS_RECT, MAX_RANK, MIN_RANK| 构造器 | 说明 |
|---|---|
CropElement(Element element) |
A constructor used to create a
CropElement based on the specified Element and the default
orientation and alignment. |
CropElement(Element element,
int alignment,
CropElement.Orientation orientation) |
A constructor used to create a
CropElement based on the specified Element, alignment,
and orientation. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getAlignment() |
Obtains the alignment of this
CropElement. |
CropElement.Orientation |
getCropOrientation() |
Obtains the cropping orientation of this
CropElement. |
void |
setAlignment(int alignment) |
Sets the alignment for this
CropElement. |
void |
setCropOrientation(CropElement.Orientation orientation) |
Sets the orientation for this
CropElement. |
clearColorMatrix, drawToCanvas, getAlpha, getBounds, getCallback, getColorMatrix, getCurrentElement, getHeight, getLayoutDirection, getMinHeight, getMinWidth, getPadding, getRank, getStateColorMode, getVisible, getWidth, isInheritDirection, isStateful, isVisible, release, setAlpha, setBounds, setBounds, setCallback, setColorMatrix, setInheritDirection, setLayoutDirection, setOnBoundsChangeListener, setOnLayoutDirectionChangeListener, setOnRankChangeListener, setRank, setStateColor, setStateColorList, setStateColorMode, setVisible, skipAnimationgetElement, setElementpublic CropElement(Element element)
CropElement based on the specified Element and the default
orientation and alignment.
The default value of orientation is horizontal, and the default value of alignment
is left.element - Indicates the Element to be cropped.public CropElement(Element element, int alignment, CropElement.Orientation orientation)
CropElement based on the specified Element, alignment,
and orientation.element - Indicates the Element to be cropped.alignment - Indicates the alignment of this CropElement.orientation - Indicates the orientation of this CropElement.public void setAlignment(int alignment)
CropElement.alignment - Indicates the alignment to set. For details on the available values,
see LayoutAlignment.public void setCropOrientation(CropElement.Orientation orientation)
CropElement.orientation - Indicates the orientation to set. For details on the available values,
see Orientation.public int getAlignment()
CropElement.LayoutAlignment.public CropElement.Orientation getCropOrientation()
CropElement.Orientation.