Cloneablepublic static class FlexLayout.LayoutConfig extends ComponentContainer.LayoutConfig
FlexLayout.height, MATCH_CONTENT, MATCH_PARENT, width| 构造器 | 说明 |
|---|---|
LayoutConfig(int width,
int height) |
A constructor used to create a
FlexLayout.LayoutConfig instance based on the specified width and
height. |
LayoutConfig(ComponentContainer.LayoutConfig source) |
A constructor used to create a
FlexLayout.LayoutConfig instance based on the attributes of a
given ComponentContainer.LayoutConfig. |
LayoutConfig(FlexLayout.LayoutConfig source) |
A constructor used to create a
FlexLayout.LayoutConfig based on the attributes of another
FlexLayout.LayoutConfig. |
LayoutConfig(Context context,
AttrSet attrSet) |
A constructor used to create a
FlexLayout.LayoutConfig instance based on the context and attribute
set. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
AlignSelf |
getAlignSelf() |
Obtains the align self attribute of the component.
|
float |
getFlexBasisFraction() |
Obtains the fraction value, which determines the main size of the component relative to its
FlexLayout. |
float |
getFlexGrow() |
Obtains the flex grow factor of the component.
|
float |
getFlexShrink() |
Obtains the flex shrink factor of the component.
|
int |
getMaxHeight() |
Obtains the maximum height of the component.
|
int |
getMaxWidth() |
Obtains the maximum width of the component.
|
int |
getMinHeight() |
Obtains the minimum width of the component.
|
int |
getMinWidth() |
Obtains the minimum width of the component.
|
void |
setAlignSelf(AlignSelf alignSelf) |
Sets the align self attribute, which specifies how the component is aligned along the cross axis.
|
void |
setFlexBasisFraction(float flexBasisFraction) |
Sets the fraction value, which determines the initial main size of the component relative to its container's
main size.
|
void |
setFlexGrow(float flexGrow) |
Sets the flex grow factor, which determines how much the component will grow relative to
the other components in the
FlexLayout when a positive free space is distributed. |
void |
setFlexShrink(float flexShrink) |
Sets the flex shrink factor, which determines how much the component will shrink relative
to the other components in the
FlexLayout when a negative free space is distributed. |
void |
setMaxHeight(int maxHeight) |
Sets the maximum height for the component.
|
void |
setMaxWidth(int maxWidth) |
Sets the maximum width for the component.
|
void |
setMinHeight(int minHeight) |
Sets the minimum height for the component.
|
void |
setMinWidth(int minWidth) |
Sets the minimum width for the component.
|
clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginToppublic LayoutConfig(Context context, AttrSet attrSet)
FlexLayout.LayoutConfig instance based on the context and attribute
set.context - Indicates the application context.attrSet - Indicates the attribute set to use.public LayoutConfig(int width,
int height)
FlexLayout.LayoutConfig instance based on the specified width and
height.width - Indicates the width to use, which can be a particular value, ComponentContainer.LayoutConfig.MATCH_PARENT, or
ComponentContainer.LayoutConfig.MATCH_CONTENT.height - Indicates the height to use, which can be a particular value, ComponentContainer.LayoutConfig.MATCH_PARENT, or
ComponentContainer.LayoutConfig.MATCH_CONTENT.public LayoutConfig(ComponentContainer.LayoutConfig source)
FlexLayout.LayoutConfig instance based on the attributes of a
given ComponentContainer.LayoutConfig.source - Indicates the source layout.public LayoutConfig(FlexLayout.LayoutConfig source)
FlexLayout.LayoutConfig based on the attributes of another
FlexLayout.LayoutConfig.source - Indicates the source layout.public void setMinWidth(int minWidth)
minWidth - Indicates the minimum width to set. The value must be in the range of [0, 0xFFFFFF].public int getMinWidth()
0 otherwise.public void setMinHeight(int minHeight)
minHeight - Indicates the minimum height to set. The value must be in the range of [0, 0xFFFFFF].public int getMinHeight()
0 otherwise.public void setMaxWidth(int maxWidth)
maxWidth - Indicates the maximum width to set. The value must be in the range of [0, 0xFFFFFF].public int getMaxWidth()
0xFFFFFF otherwise.public void setMaxHeight(int maxHeight)
maxHeight - Indicates the maximum height to set. The value must be in the range of [0, 0xFFFFFF].public int getMaxHeight()
0xFFFFFF otherwise.public void setFlexGrow(float flexGrow)
FlexLayout when a positive free space is distributed.flexGrow - Indicates the flex grow factor to set. A negative value will be ignored.public float getFlexGrow()
public void setFlexShrink(float flexShrink)
FlexLayout when a negative free space is distributed.flexShrink - Indicates the flex shrink factor to set. A negative value will be ignored.public float getFlexShrink()
public void setAlignSelf(AlignSelf alignSelf)
alignSelf - Indicates the align self attribute to set. For details, see AlignSelf.public AlignSelf getAlignSelf()
public void setFlexBasisFraction(float flexBasisFraction)
This setting is effective only when the FlexLayout's main size is determined, for example, the
EstimateSpec for the
layout is EstimateSpec#PRECISE during the measure process. It will override the dimension specified
by ComponentContainer.LayoutConfig.width or ComponentContainer.LayoutConfig.height.
flexBasisFraction - Indicates the fraction value to set, which must be in range of [0.0, 1.0].public float getFlexBasisFraction()
FlexLayout.-1.0 otherwise.