harmony 鸿蒙Enums

2022-08-09 浏览 (1187)

Enums

NOTE

The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Color

Since API version 9, this API is supported in ArkTS widgets.

ColorValueIllustration
Black0x000000en-us_image_0000001219864153
Blue0x0000ffen-us_image_0000001174104404
Brown0xa52a2aen-us_image_0000001219744201
Gray0x808080en-us_image_0000001174264376
Grey0x808080en-us_image_0000001174264376
Green0x008000en-us_image_0000001174422914
Orange0xffa500en-us_image_0000001219662661
Pink0xffc0cben-us_image_0000001219662663
Red0xff0000en-us_image_0000001219662665
White0xffffffen-us_image_0000001174582866
Yellow0xffff00en-us_image_0000001174582864
Transparent9+rgba(0,0,0,0)Transparent

ImageFit

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
ContainThe image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries.
CoverThe image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.
AutoThe image is scaled automatically to fit the display area.
FillThe image is scaled to fill the display area, and its aspect ratio is not retained.
ScaleDownThe image is displayed with its aspect ratio retained, in a size smaller than or equal to the original size.
NoneThe original size is retained.

BorderStyle

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
DottedDotted border. The radius of a dot is half of borderWidth.
DashedDashed border.
SolidSolid border.

LineJoinStyle

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
BevelBevel is used to connect paths.
MiterMiter is used to connect paths.
RoundRound is used to connect paths.

TouchType

NameDescription
DownA finger is pressed.
UpA finger is lifted.
MoveA finger moves on the screen in pressed state.
CancelA touch event is canceled.

MouseButton

NameDescription
LeftLeft button on the mouse.
RightRight button on the mouse.
MiddleMiddle button on the mouse.
BackBack button on the left of the mouse.
ForwardForward button on the left of the mouse.
NoneNo button.

MouseAction

NameDescription
PressThe mouse button is pressed.
ReleaseThe mouse button is released.
MoveThe mouse cursor moves.
HoverThe mouse pointer is hovered on an element.
NOTE
This value has no effect.

Curve

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
LinearThe animation speed keeps unchanged.
EaseThe animation starts slowly, accelerates, and then slows down towards the end. The cubic-bezier curve (0.25, 0.1, 0.25, 1.0) is used.
EaseInThe animation starts at a low speed and then picks up speed until the end. The cubic-bezier curve (0.42, 0.0, 1.0, 1.0) is used.
EaseOutThe animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used.
EaseInOutThe animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used.
FastOutSlowInThe animation uses the standard cubic-bezier curve (0.4, 0.0, 0.2, 1.0).
LinearOutSlowInThe animation uses the deceleration cubic-bezier curve (0.0, 0.0, 0.2, 1.0).
FastOutLinearInThe animation uses the acceleration cubic-bezier curve (0.4, 0.0, 1.0, 1.0).
ExtremeDecelerationThe animation uses the extreme deceleration cubic-bezier curve (0.0, 0.0, 0.0, 1.0).
SharpThe animation uses the sharp cubic-bezier curve (0.33, 0.0, 0.67, 1.0).
RhythmThe animation uses the rhythm cubic-bezier curve (0.7, 0.0, 0.2, 1.0).
SmoothThe animation uses the smooth cubic-bezier curve (0.4, 0.0, 0.4, 1.0).
FrictionThe animation uses the friction cubic-bezier curve (0.2, 0.0, 0.2, 1.0).

AnimationStatus

Since API version 10, this API is supported in ArkTS widgets.

NameDescription
InitialThe animation is in the initial state.
RunningThe animation is being played.
PausedThe animation is paused.
StoppedThe animation is stopped.

FillMode

Since API version 10, this API is supported in ArkTS widgets.

NameDescription
NoneBefore execution, the animation does not apply any styles to the target component. After execution, the animation restores the target component to its default state.
ForwardsThe target component retains the state set by the last keyframe encountered during execution of the animation.
BackwardsThe animation applies the values defined in the first relevant keyframe once it is applied to the target component, and retains the values during the period set by delay. The first relevant keyframe depends on the value of playMode. If playMode is Normal or Alternate, the first relevant keyframe is in the from state. If playMode is Reverse or AlternateReverse, the first relevant keyframe is in the to state.
BothThe animation follows the rules for both Forwards and Backwards, extending the animation attributes in both directions.

PlayMode

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NormalThe animation is played forwards.
ReverseThe animation is played backwards.
AlternateThe animation is played forwards for an odd number of times (1, 3, 5...) and backwards for an even number of times (2, 4, 6...).
AlternateReverseThe animation is played backwards for an odd number of times (1, 3, 5...) and forwards for an even number of times (2, 4, 6...).

KeyType

NameDescription
DownThe key is pressed.
UpThe key is released.

KeySource

NameDescription
UnknownUnknown input device.
KeyboardThe input device is a keyboard.

Edge

NameDescription
TopTop edge in the vertical direction.
Since API version 9, this API is supported in ArkTS widgets.
Center(deprecated) Center position in the vertical direction.
This API is deprecated since API version 9.
BottomBottom edge in the vertical direction.
Since API version 9, this API is supported in ArkTS widgets.
Baseline(deprecated) Text baseline position in the cross axis direction.
This API is deprecated since API version 9.
StartStart position in the horizontal direction.
Since API version 9, this API is supported in ArkTS widgets.
Middle(deprecated) Center position in the horizontal direction.
This API is deprecated since API version 9.
EndEnd position in the horizontal direction.
Since API version 9, this API is supported in ArkTS widgets.

Week

NameDescription
MonMonday.
TueTuesday.
WedWednesday.
ThurThursday.
FriFriday.
SatSaturday.
SunSunday.

Direction

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
LtrComponents are arranged from left to right.
RtlComponents are arranged from right to left.
AutoThe default layout direction is used.

BarState

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
OffNot displayed.
OnAlways displayed.
AutoDisplayed when the screen is touched and hidden after 2s.

EdgeEffect

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
SpringSpring effect. When at one of the edges, the component can move beyond the bounds through touches, and produces a bounce effect when the user releases their finger.
FadeFade effect. When at one of the edges, the component produces a fade effect.
NoneNo effect when the component is at one of the edges.

Alignment

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
TopStartTop start.
TopHorizontally centered on the top.
TopEndTop end.
StartVertically centered start.
CenterHorizontally and vertically centered.
EndVertically centered end.
BottomStartBottom start.
BottomHorizontally centered on the bottom.
BottomEndBottom end.

TransitionType

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
AllThe transition takes effect in all scenarios.
InsertThe transition takes effect when a component is inserted or displayed.
DeleteThe transition takes effect when a component is deleted or hidden.

RelateType

NameDescription
FILLThe current child component is scaled to fill the parent component.
FITThe current child component is scaled to adapt to the parent component.

Visibility

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
HiddenThe component is hidden, and a placeholder is used for it in the layout.
VisibleThe component is visible.
NoneThe component is hidden. It is not involved in the layout, and no placeholder is used for it.

LineCapStyle

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
ButtThe ends of the line are squared off, and the line does not extend beyond its two endpoints.
RoundThe line is extended at the endpoints by a half circle whose diameter is equal to the line width.
SquareThe line is extended at the endpoints by a rectangle whose width is equal to half the line width and height equal to the line width.

Axis

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
VerticalVertical direction.
HorizontalHorizontal direction.

HorizontalAlign

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
StartAligned with the start edge in the same direction as the language in use.
CenterAligned with the center. This is the default alignment mode.
EndAligned with the end edge in the same direction as the language in use.

FlexAlign

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
StartThe child components are aligned with the start edge of the main axis. The first component is aligned with the main-start, and subsequent components are aligned with the previous one.
CenterThe child components are aligned in the center of the main axis. The space between the first component and the main-start is the same as that between the last component and the main-end.
EndThe child components are aligned with the end edge of the main axis. The last component is aligned with the main-end, and other components are aligned with the next one.
SpaceBetweenThe child components are evenly distributed along the main axis. The space between any two adjacent components is the same. The first component is aligned with the main-start, the last component is aligned with the main-end, and the remaining components are distributed so that the space between any two adjacent components is the same.
SpaceAroundThe child components are evenly distributed along the main axis. The space between any two adjacent components is the same. The space between the first component and main-start, and that between the last component and cross-main are both half the size of the space between two adjacent components.
SpaceEvenlyThe child components are evenly distributed along the main axis. The space between the first component and main-start, the space between the last component and main-end, and the space between any two adjacent components are the same.

ItemAlign

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
AutoThe default configuration of the flex container is used.
StartThe items in the flex container are aligned with the cross-start edge.
CenterThe items in the flex container are centered along the cross axis.
EndThe items in the flex container are aligned with the cross-end edge.
StretchThe items in the flex container are stretched and padded along the cross axis. If the flex container has the Wrap attribute set to FlexWrap.Wrap or FlexWrap.WrapReverse, the items are stretched to the cross size of the widest element on the current row or column. In other cases, the items with no size set are stretched to the container size.
BaselineThe items in the flex container are aligned in such a manner that their text baselines are aligned along the cross axis.

FlexDirection

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
RowThe child components are arranged in the same direction as the main axis runs along the rows.
RowReverseThe child components are arranged opposite to the Row direction.
ColumnThe child components are arranged in the same direction as the main axis runs down the columns.
ColumnReverseThe child components are arranged opposite to the Column direction.

FlexWrap

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NoWrapThe child components in the flex container are arranged in a single line, and they cannot overflow.
WrapThe child components in the flex container are arranged in multiple lines, and they may overflow.
WrapReverseThe child components in the flex container are reversely arranged in multiple lines, and they may overflow.

VerticalAlign

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
TopTop aligned.
CenterCenter aligned. This is the default alignment mode.
BottomBottom aligned.

ImageRepeat

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
XThe image is repeatedly drawn only along the horizontal axis.
YThe image is repeatedly drawn only along the vertical axis.
XYThe image is repeatedly drawn along both axes.
NoRepeatThe image is not repeatedly drawn.

ImageSize

Since API version 9, this API is supported in ArkTS widgets.

TypeDescription
CoverDefault value. The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.
ContainThe image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries.
AutoThe original image aspect ratio is retained.

GradientDirection

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
LeftThe gradient direction is from right to left.
TopThe gradient direction is from bottom to top.
RightThe gradient direction is from left to right.
BottomThe gradient direction is from top to bottom.
LeftTopThe gradient direction is upper left.
LeftBottomThe gradient direction is lower left.
RightTopThe gradient direction is upper right.
RightBottomThe gradient direction is lower right.
NoneNo gradient.

SharedTransitionEffectType

NameDescription
StaticThe element position remains unchanged on the target page, and transition opacity can be configured. Currently, this effect is only valid in redirecting to the target page.
ExchangeThe element is relocated and scaled properly on the target page.

FontStyle

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NormalStandard font style.
ItalicItalic font style.

FontWeight

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
LighterThe font weight is lighter.
NormalThe font weight is normal.
RegularThe font weight is regular.
MediumThe font weight is medium.
BoldThe font weight is bold.
BolderThe font weight is bolder.

TextAlign

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
StartAligned with the start.
CenterHorizontally centered.
EndAligned with the end.
JUSTIFY10+Aligned with both margins.

TextOverflow

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NoneExtra-long text is clipped.
ClipExtra-long text is clipped.
EllipsisAn ellipsis (...) is used to represent text overflow.
MARQUEE10+Text continuously scrolls when text overflow occurs.

TextDecorationType

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
UnderlineLine under the text.
LineThroughLine through the text.
OverlineLine over the text.
NoneNo decorative lines.

TextCase

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NormalThe original case of the text is retained.
LowerCaseAll letters in the text are in lowercase.
UpperCaseAll letters in the text are in uppercase.

ResponseType8+

NameDescription
LongPressThe menu is displayed when the component is long-pressed.
RightClickThe menu is displayed when the component is right-clicked.

HoverEffect8+

NameDescription
AutoDefault hover effect.
ScaleScale effect.
HighlightBackground fade-in and fade-out effect.
NoneNo effect.

Placement8+

NameDescription
LeftThe popup is on the left of the component, vertically aligned with the component on the left.
RightThe popup is on the right of the component, vertically aligned with the component on the right.
TopThe popup is at the top of the component, horizontally aligned with the component at the top.
BottomThe popup is at the bottom of the component, horizontally aligned with the component at the bottom.
TopLeftThe popup is at the top of the component and, since API version 9, aligned with the left of the component.
TopRightThe popup is at the top of the component and, since API version 9, aligned with the right of the component.
BottomLeftThe popup is at the bottom of the component and, since API version 9, aligned with the left of the component.
BottomRightThe popup is at the bottom of the component and, since API version 9, aligned with the right of the component.
LeftTop9+The popup is on the left of the component and aligned with the top of the component.
LeftBottom9+The popup is on the left of the component and aligned with the bottom of the component.
RightTop9+The popup is on the right of the component and aligned with the top of the component.
RightBottom9+The popup is on the right of the component and aligned with the bottom of the component.

CopyOptions9+

Since API version 9, this API is supported in ArkTS widgets.

NameDescription
NoneCopy is not allowed.
InAppIntra-application copy is allowed.
LocalDeviceIntra-device copy is allowed.

HitTestMode9+

NameDescription
DefaultBoth the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from the hit test.
BlockThe node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test.
TransparentBoth the node and its child node respond to the hit test of a touch event, and its sibling node is also considered during the hit test.
NoneThe node does not respond to the hit test of a touch event, but its child node and sibling node are considered during the hit test.

BlurStyle9+

This API is supported in ArkTS widgets.

NameDescription
ThinThin material.
RegularRegular material.
ThickThick material.
BACKGROUND_THINMaterial that creates the minimum depth of field effect.
BACKGROUND_REGULARMaterial that creates a medium shallow depth of field effect.
BACKGROUND_THICKMaterial that creates a high shallow depth of field effect.
BACKGROUND_ULTRA_THICKMaterial that creates the maximum depth of field effect.
NONE10+No blur.

ThemeColorMode10+

NameDescription
SYSTEMFollowing the system color mode.
LIGHTLight color mode.
DARKDark color mode.

AdaptiveColor10+

NameDescription
DEFAULTAdaptive color mode is not used. The default color is used as the mask color.
AVERAGEAdaptive color mode is used. The average color value of the color picking area is used as the mask color.

TextHeightAdaptivePolicy10+

NameDescription
MAX_LINES_FIRSTPrioritize the maxLines settings.
MIN_FONT_SIZE_FIRSTPrioritize the minFontSize settings.
LAYOUT_CONSTRAINT_FIRSTPrioritize the layout constraint settings in terms of height.

ObscuredReasons10+

This API is supported in ArkTS widgets.

NameDescription
PLACEHOLDERThe content is replaced by a placeholder.

TransitionEdge10+

NameDescription
TOPTop edge of the window.
BOTTOMBottom edge of the window.
STARTLeft edge of the window.
ENDRight edge of the window.

ClickEffectLevel10+

NameDescriptionAnimation SettingsDefault Zoom Ratio
LIGHTSmall area (light)Spring effect, with stiffness of 410, damping of 38, and initial velocity of 1.90%
MIDDLEMedium area (stable)Spring effect, with stiffness of 350, damping of 35, and initial velocity of 0.5.95%
HEAVYLarge area (heavy)Spring effect, with stiffness of 240, damping of 28, and initial velocity of 0.95%

TextContentStyle10+

NameDescription
DEFAULTDefault style. The caret width is fixed at 1.5 vp, and the caret height is subject to the background height and font size of the selected text.
INLINEInline input style. The background height of the selected text is the same as the height of the text box.
The showError attribute is not supported for this style.

MenuPreviewMode 11+

NameDescription
NONENo preview is displayed.
IMAGEThe preview is a screenshot of the component on which a long-press triggers the context menu.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkTS-based Declarative Development Paradigm

harmony 鸿蒙@ohos.multimedia.avCastPicker (AVCastPicker)

harmony 鸿蒙Property Animation

harmony 鸿蒙Blank

harmony 鸿蒙Button

harmony 鸿蒙CalendarPicker

harmony 鸿蒙Checkbox

harmony 鸿蒙CheckboxGroup

harmony 鸿蒙DataPanel

harmony 鸿蒙DatePicker

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/e4e9aca48f3d4e40842f0a7d2d9b71cb