You need to sign in or sign up before continuing.
提交 33a73451 编写于 作者: H HelloCrease

update docs

Signed-off-by: NHelloCrease <lian15@huawei.com>
上级 ecfff8ff
......@@ -3,7 +3,7 @@
## Color
| Color | Value | Illustration |
| ------------------------ | -------- | ------------------------------------------------------------ |
| ------------------------ | ------------- | ---------------------------------------- |
| Black | 0x000000 | ![en-us_image_0000001219864153](figures/en-us_image_0000001219864153.png) |
| Blue | 0x0000ff | ![en-us_image_0000001174104404](figures/en-us_image_0000001174104404.png) |
| Brown | 0xa52a2a | ![en-us_image_0000001219744201](figures/en-us_image_0000001219744201.png) |
......@@ -20,9 +20,9 @@
## ImageFit
| Name | Description |
| --------- | ------------------------------------------------------------ |
| --------- | ---------------------------------------- |
| Contain | The image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries. |
| Cover | The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.|
| Cover | The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries. |
| Auto | The image is scaled automatically to fit the display area. |
| Fill | The image is scaled to fill the display area, and its aspect ratio is not retained. |
| ScaleDown | The image is displayed with its aspect ratio retained, in a size smaller than or equal to the original size. |
......@@ -31,57 +31,57 @@
## BorderStyle
| Name | Description |
| ------ | ----------------------------------------------- |
| Dotted | Dotted border. The radius of a dot is half of **borderWidth**.|
| ------ | ---------------------------------------- |
| Dotted | Dotted border. The radius of a dot is half of **borderWidth**. |
| Dashed | Dashed border. |
| Solid | Solid border. |
## LineJoinStyle
| Name | Description |
| ----- | -------------------- |
| Bevel | Bevel is used to connect paths.|
| Miter | Miter is used to connect paths.|
| Round | Round is used to connect paths.|
| ----- | ------------------------------- |
| Bevel | Bevel is used to connect paths. |
| Miter | Miter is used to connect paths. |
| Round | Round is used to connect paths. |
## TouchType
| Name | Description |
| ------ | ------------------------------ |
| ------ | ---------------------------------------- |
| Down | A finger is pressed. |
| Up | A finger is lifted. |
| Move | A finger moves on the screen in pressed state.|
| Move | A finger moves on the screen in pressed state. |
| Cancel | A touch event is canceled. |
## MouseButton
| Name | Description |
| ------- | ---------------- |
| ------- | ---------------------------------------- |
| Left | Left button on the mouse. |
| Right | Right button on the mouse. |
| Middle | Middle button on the mouse. |
| Back | Back button on the left of the mouse.|
| Forward | Forward button on the left of the mouse.|
| Back | Back button on the left of the mouse. |
| Forward | Forward button on the left of the mouse. |
| None | No button. |
## MouseAction
| Name | Description |
| ------- | -------------- |
| Press | The mouse button is pressed.|
| Release | The mouse button is released.|
| ------- | ---------------------------------------- |
| Press | The mouse button is pressed. |
| Release | The mouse button is released. |
| Move | The mouse cursor moves. |
| Hover | The mouse pointer is hovered on an element. |
## Curve
| Name | Description |
| ------------------- | ------------------------------------------------------------ |
| ------------------- | ---------------------------------------- |
| Linear | The animation speed keeps unchanged. |
| Ease | The 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.|
| Ease | The 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. |
| EaseIn | The 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. |
| EaseOut | The animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used. |
| EaseInOut | The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used.|
| EaseInOut | The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used. |
| FastOutSlowIn | The animation uses the standard cubic-bezier curve (0.4, 0.0, 0.2, 1.0). |
| LinearOutSlowIn | The animation uses the deceleration cubic-bezier curve (0.0, 0.0, 0.2, 1.0). |
| FastOutLinearIn | The animation uses the acceleration cubic-bezier curve (0.4, 0.0, 1.0, 1.0). |
......@@ -94,48 +94,48 @@
## AnimationStatus
| Name | Description |
| ------- | ------------------ |
| ------- | -------------------------------------- |
| Initial | The animation is in the initial state. |
| Running | The animation is being played.|
| Paused | The animation is paused.|
| Stopped | The animation is stopped.|
| Running | The animation is being played. |
| Paused | The animation is paused. |
| Stopped | The animation is stopped. |
## FillMode
| Name | Description |
| --------- | ------------------------------------------------------------ |
| None | Before execution, the animation does not apply any styles to the target component. After execution, the animation restores the target component to its default state.|
| --------- | ---------------------------------------- |
| None | Before execution, the animation does not apply any styles to the target component. After execution, the animation restores the target component to its default state. |
| Forwards | The target component retains the state set by the last keyframe encountered during execution of the animation. |
| Backwards | The 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.|
| Both | The animation follows the rules for both **Forwards** and **Backwards**, extending the animation attributes in both directions.|
| Backwards | The 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. |
| Both | The animation follows the rules for both **Forwards** and **Backwards**, extending the animation attributes in both directions. |
## PlayMode
| Name | Description |
| ---------------- | ------------------------------------------------------------ |
| ---------------- | ---------------------------------------- |
| Normal | The animation is played forwards. |
| Reverse | The animation is played backwards. |
| Alternate | The animation is played forwards for an odd number of times (1, 3, 5...) and backwards for an even number of times (2, 4, 6...).|
| AlternateReverse | The animation is played backwards for an odd number of times (1, 3, 5...) and forwards for an even number of times (2, 4, 6...).|
| Alternate | The animation is played forwards for an odd number of times (1, 3, 5...) and backwards for an even number of times (2, 4, 6...). |
| AlternateReverse | The 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
| Name| Description |
| ---- | ---------- |
| Down | The key is pressed.|
| Up | The key is released.|
| Name | Description |
| ---- | -------------------- |
| Down | The key is pressed. |
| Up | The key is released. |
## KeySource
| Name | Description |
| -------- | -------------------- |
| -------- | ------------------------------- |
| Unknown | Unknown input device. |
| Keyboard | The input device is a keyboard.|
| Keyboard | The input device is a keyboard. |
## Edge
| Name | Description |
| -------- | ---------------------- |
| -------------------------------- | ---------------------------------------- |
| Top | Top edge in the vertical direction. |
| Center<sup>(deprecated) </sup> | Center position in the vertical direction.<br>This API is deprecated since API version 9. |
| Bottom | Bottom edge in the vertical direction. |
......@@ -147,7 +147,7 @@
## Week
| Name | Description |
| -------- | ---------------------- |
| ---- | ----------- |
| Mon | Monday. |
| Tue | Tuesday. |
| Wed | Wednesday. |
......@@ -158,37 +158,37 @@
## Direction
| Name| Description |
| ---- | ---------------------- |
| Name | Description |
| ---- | ---------------------------------------- |
| Ltr | Components are arranged from left to right. |
| Rtl | Components are arranged from right to left. |
| Auto | The default layout direction is used.|
| Auto | The default layout direction is used. |
## BarState
| Name| Description |
| ---- | -------------------------------- |
| Name | Description |
| ---- | ---------------------------------------- |
| Off | Not displayed. |
| On | Always displayed. |
| Auto | Displayed when the screen is touched and hidden after 2s.|
| Auto | Displayed when the screen is touched and hidden after 2s. |
## EdgeEffect
| Name | Description |
| ------ | ------------------------------------------------------------ |
| Spring | Spring 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.|
| ------ | ---------------------------------------- |
| Spring | Spring 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. |
| Fade | Fade effect. When at one of the edges, the component produces a fade effect. |
| None | No effect when the component is at one of the edges. |
## Alignment
| Name | Description |
| ----------- | ---------------- |
| ----------- | ------------------------------------- |
| TopStart | Top start. |
| Top | Horizontally centered on the top. |
| TopEnd | Top end. |
| Start | Vertically centered start.|
| Center | Horizontally and vertically centered.|
| Start | Vertically centered start. |
| Center | Horizontally and vertically centered. |
| End | Vertically centered end. |
| BottomStart | Bottom start. |
| Bottom | Horizontally centered on the bottom. |
......@@ -197,121 +197,121 @@
## TransitionType
| Name | Description |
| ------ | -------------------------------------------------- |
| All | The transition takes effect in all scenarios.|
| ------ | ---------------------------------------- |
| All | The transition takes effect in all scenarios. |
| Insert | The transition takes effect when a component is inserted. |
| Delete | The transition takes effect when a component is deleted. |
## RelateType
| Name | Description |
| ------ | ------------------------------- |
| ---- | ---------------------------------------- |
| FILL | The current child component is scaled to fill the parent component. |
| FIT | The current child component is scaled to adapt to the parent component. |
## Visibility
| Name | Description |
| ------- | -------------------------------- |
| ------- | ---------------------------------------- |
| Hidden | The component is hidden, and a placeholder is used for it in the layout. |
| Visible | The component is visible. |
| None | The component is hidden. It is not involved in the layout, and no placeholder is used for it.|
| None | The component is hidden. It is not involved in the layout, and no placeholder is used for it. |
## LineCapStyle
| Name | Description |
| ------ | -------------------- |
| Butt | The ends of the line are squared off, and the line does not extend beyond its two endpoints.|
| Round | The line is extended at the endpoints by a half circle whose diameter is equal to the line width.|
| Square | The 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.|
| ------ | ---------------------------------------- |
| Butt | The ends of the line are squared off, and the line does not extend beyond its two endpoints. |
| Round | The line is extended at the endpoints by a half circle whose diameter is equal to the line width. |
| Square | The 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
| Name | Description |
| ---------- | ------------ |
| Vertical | Vertical direction.|
| Horizontal | Horizontal direction.|
| ---------- | --------------------- |
| Vertical | Vertical direction. |
| Horizontal | Horizontal direction. |
## HorizontalAlign
| Name | Description |
| ------ | ------------------------ |
| Start | Aligned with the start edge in the same direction as the language in use.|
| Center | Aligned with the center. This is the default alignment mode.|
| ------ | ---------------------------------------- |
| Start | Aligned with the start edge in the same direction as the language in use. |
| Center | Aligned with the center. This is the default alignment mode. |
| End | Aligned with the end edge in the same direction as the language in use. |
## FlexAlign
| Name | Description |
| ------------ | ------------------------------------------------------------ |
| Start | The 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.|
| Center | The 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.|
| End | The 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.|
| SpaceBetween | The 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.|
| SpaceAround | The 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.|
| ------------ | ---------------------------------------- |
| Start | The 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. |
| Center | The 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. |
| End | The 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. |
| SpaceBetween | The 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. |
| SpaceAround | The 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. |
| SpaceEvenly | The 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
| Name | Description |
| -------- | ------------------------------------------------------------ |
| -------- | ---------------------------------------- |
| Auto | The default configuration in the flex container is used. |
| Start | The elements are in the flex container, top-aligned in the cross-axis direction. |
| Center | The elements are in the flex container, centered in the cross-axis direction. |
| End | The elements are in the flex container, bottom-aligned in the cross-axis direction. |
| Stretch | The elements are in the flex container, stretched and padded in the cross-axis direction. If the size is not set, the elements are stretched to the container size.|
| Stretch | The elements are in the flex container, stretched and padded in the cross-axis direction. If the size is not set, the elements are stretched to the container size. |
| Baseline | The elements are in the flex container, text baseline aligned in the cross-axis direction. |
## FlexDirection
| Name | Description |
| ------------- | ------------------------------ |
| Row | The child components are arranged in the same direction as the main axis runs along the rows.|
| ------------- | ---------------------------------------- |
| Row | The child components are arranged in the same direction as the main axis runs along the rows. |
| RowReverse | The child components are arranged opposite to the **Row** direction. |
| Column | The child components are arranged in the same direction as the main axis runs down the columns.|
| Column | The child components are arranged in the same direction as the main axis runs down the columns. |
| ColumnReverse | The child components are arranged opposite to the **Column** direction. |
## FlexWrap
| Name | Description |
| ----------- | ------------------------------------------------- |
| ----------- | ---------------------------------------- |
| NoWrap | The child components in the flex container are arranged in a single line, and they cannot overflow. |
| Wrap | The child components in the flex container are arranged in multiple lines, and they may overflow. |
| WrapReverse | The child components in the flex container are reversely arranged in multiple lines, and they may overflow.|
| WrapReverse | The child components in the flex container are reversely arranged in multiple lines, and they may overflow. |
## VerticalAlign
| Name | Description |
| ------ | ------------------------ |
| ------ | ---------------------------------------- |
| Top | Top aligned. |
| Center | Center aligned. This is the default alignment mode.|
| Center | Center aligned. This is the default alignment mode. |
| Bottom | Bottom aligned. |
## ImageRepeat
| Name | Description |
| -------- | -------------------------- |
| X | The image is repeatedly drawn only along the horizontal axis.|
| Y | The image is repeatedly drawn only along the vertical axis.|
| -------- | ---------------------------------------- |
| X | The image is repeatedly drawn only along the horizontal axis. |
| Y | The image is repeatedly drawn only along the vertical axis. |
| XY | The image is repeatedly drawn along both axes. |
| NoRepeat | The image is not repeatedly drawn. |
## ImageSize
| Type | Description |
| ------- | ------------------------------------------------------------ |
| Cover | Default value. The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.|
| ------- | ---------------------------------------- |
| Cover | Default value. The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries. |
| Contain | The image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries. |
| Auto | The original image aspect ratio is retained. |
## GradientDirection
| Name | Description |
| ----------- | ---------- |
| Left | The gradient direction is from right to left.|
| Top | The gradient direction is from bottom to top.|
| Right | The gradient direction is from left to right.|
| Bottom | The gradient direction is from top to bottom.|
| ----------- | ---------------------------------------- |
| Left | The gradient direction is from right to left. |
| Top | The gradient direction is from bottom to top. |
| Right | The gradient direction is from left to right. |
| Bottom | The gradient direction is from top to bottom. |
| LeftTop | The gradient direction is upper left. |
| LeftBottom | The gradient direction is lower left. |
| RightTop | The gradient direction is upper right. |
......@@ -321,73 +321,73 @@
## SharedTransitionEffectType
| Name | Description |
| ----------- | ---------- |
| Static | The 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.|
| Exchange | The element is relocated and scaled properly on the target page.|
| -------- | ---------------------------------------- |
| Static | The 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. |
| Exchange | The element is relocated and scaled properly on the target page. |
## FontStyle
| Name | Description |
| ------ | ---------------- |
| Normal | Standard font style.|
| Italic | Italic font style.|
| ------ | -------------------- |
| Normal | Standard font style. |
| Italic | Italic font style. |
## FontWeight
| Name | Description |
| ------- | -------------- |
| ------- | --------------------------- |
| Lighter | The font weight is lighter. |
| Normal | The font weight is normal.|
| Regular | The font weight is regular.|
| Medium | The font weight is medium.|
| Normal | The font weight is normal. |
| Regular | The font weight is regular. |
| Medium | The font weight is medium. |
| Bold | The font weight is bold. |
| Bolder | The font weight is bolder. |
## TextAlign
| Name | Description |
| ------ | -------------- |
| Start | Aligned with the start.|
| Center | Horizontally centered.|
| End | Aligned with the end.|
| ------ | ----------------------- |
| Start | Aligned with the start. |
| Center | Horizontally centered. |
| End | Aligned with the end. |
## TextOverflow
| Name | Description |
| -------- | -------------------------------------- |
| -------- | ---------------------------------------- |
| Clip | Extra-long text is clipped. |
| Ellipsis | An ellipsis (...) is used to represent clipped text.|
| Ellipsis | An ellipsis (...) is used to represent clipped text. |
| None | No clipping or ellipsis is used for extra-long text. |
## TextDecorationType
| Name | Description |
| ----------- | ------------------ |
| ----------- | ---------------------- |
| Underline | Line under the text. |
| LineThrough | Line through the text.|
| LineThrough | Line through the text. |
| Overline | Line over the text. |
| None | No decorative lines.|
| None | No decorative lines. |
## TextCase
| Name | Description |
| --------- | -------------------- |
| Normal | The original case of the text is retained.|
| --------- | ---------------------------------------- |
| Normal | The original case of the text is retained. |
| LowerCase | All letters in the text are in lowercase. |
| UpperCase | All letters in the text are in uppercase. |
## ResponseType<sup>8+</sup>
| Name | Description |
| ---------- | -------------------------- |
| ---------- | ---------------------------------------- |
| LongPress | The menu is displayed when the component is long-pressed. |
| RightClick | The menu is displayed when the component is right-clicked.|
| RightClick | The menu is displayed when the component is right-clicked. |
## HoverEffect<sup>8+</sup>
| Name | Description |
| --------- | ---------------------------- |
| Auto | Default hover effect.|
| --------- | --------------------------------------- |
| Auto | Default hover effect. |
| Scale | Scale effect. |
| Highlight | Background fade-in and fade-out effect. |
| None | No effect. |
......@@ -395,15 +395,15 @@
## Placement<sup>8+</sup>
| Name | Description |
| ------------- | ------------------------------------------------------------ |
| ------------- | ---------------------------------------- |
| Left | The popup is on the left of the component, vertically aligned with the component on the left. |
| Right | The popup is on the right of the component, vertically aligned with the component on the right. |
| Top | The popup is at the top of the component, horizontally aligned with the component at the top. |
| Bottom | The popup is at the bottom of the component, horizontally aligned with the component at the bottom. |
| TopLeft | The popup is at the top of the component and, since API version 9, aligned with the left of the component.|
| TopRight | The popup is at the top of the component and, since API version 9, aligned with the right of the component.|
| BottomLeft | The popup is at the bottom of the component and, since API version 9, aligned with the left of the component.|
| BottomRight | The popup is at the bottom of the component and, since API version 9, aligned with the right of the component.|
| TopLeft | The popup is at the top of the component and, since API version 9, aligned with the left of the component. |
| TopRight | The popup is at the top of the component and, since API version 9, aligned with the right of the component. |
| BottomLeft | The popup is at the bottom of the component and, since API version 9, aligned with the left of the component. |
| BottomRight | The 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. |
......@@ -412,16 +412,16 @@
## CopyOptions<sup>9+</sup>
| Name | Description |
| ----------- | -------------------- |
| ----------- | ---------------------------------- |
| None | Copy is not allowed. |
| InApp | Intra-application copy is allowed.|
| LocalDevice | Intra-device copy is allowed.|
| InApp | Intra-application copy is allowed. |
| LocalDevice | Intra-device copy is allowed. |
## HitTestMode<sup>9+</sup>
| Name | Description |
| ----------- | -------------------- |
| ----------- | ---------------------------------------- |
| Default | Both 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. |
| Block | The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test. |
| Transparent | Both 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.|
| None | The 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.|
| Transparent | Both 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. |
| None | The 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. |
......@@ -16,31 +16,31 @@ Refresh\(value: \{ refreshing: boolean, offset?: number | string , friction?: n
**Parameters**
| Name| Value Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| refreshing | boolean | Yes| Whether the current component is being refreshed.<br>This parameter can be used with [$$](../../ui/ts-syntactic-sugar.md) for two-way binding of variables.|
| offset | string \| number | No| Distance to the top of the parent component from the **<Refresh\>** component that comes to rest after a successful pull-down gesture.<br>Default value: **16**, in vp|
| friction | number \| string | No| Coefficient of friction, which indicates the **<Refresh\>** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100.<br>Default value: **62**<br>- **0** indicates that the **\<Refresh>** component is not sensitive to the pull-down gesture.<br>- **100** indicates that the **\<Refresh>** component is highly sensitive to the pull-down gesture.<br>- A larger value indicates a more sensitive response of the **\<Refresh>** component to the pull-down gesture.|
| Name | Value Type | Mandatory | Description |
| ---------- | ---------------- | --------- | ---------------------------------------- |
| refreshing | boolean | Yes | Whether the current component is being refreshed.<br>This parameter can be used with $$ for two-way binding of variables. |
| offset | string \| number | No | Distance to the top of the parent component from the **<Refresh\>** component that comes to rest after a successful pull-down gesture.<br>Default value: **16**, in vp |
| friction | number \| string | No | Coefficient of friction, which indicates the **<Refresh\>** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100.<br>Default value: **62**<br>- **0** indicates that the **\<Refresh>** component is not sensitive to the pull-down gesture.<br>- **100** indicates that the **\<Refresh>** component is highly sensitive to the pull-down gesture.<br>- A larger value indicates a more sensitive response of the **\<Refresh>** component to the pull-down gesture. |
## Events
| Name| Description|
| -------- | -------- |
| onStateChange(callback: (state: RefreshStatus) => void)| Triggered when the refresh status changes.<br>- **state**: refresh status.|
| onRefreshing(callback: () => void)| Triggered when the component enters the refresh state.|
| Name | Description |
| ---------------------------------------- | ---------------------------------------- |
| onStateChange(callback: (state: RefreshStatus) => void) | Triggered when the refresh status changes.<br>- **state**: refresh status. |
| onRefreshing(callback: () => void) | Triggered when the component enters the refresh state. |
## RefreshStatus enums
| Name| Description|
| -------- | -------- |
| Inactive | The component is not pulled down. This is the default value.|
| Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh.|
| OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh.|
| Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state.|
| Done | The refresh is complete, and the component returns to the initial state (top).|
| Name | Description |
| -------- | ---------------------------------------- |
| Inactive | The component is not pulled down. This is the default value. |
| Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh. |
| OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh. |
| Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state. |
| Done | The refresh is complete, and the component returns to the initial state (top). |
## Example
......
......@@ -17,22 +17,22 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, aut
**Parameters**
| Name | Type | Mandatory | Description |
| ---------------------- | ---------------------------------------- | ------------------------- | ---------------------- |
| builder | [CustomDialog](../../ui/ts-component-based-customdialog.md) | Yes | Constructor of the custom dialog box content. |
| ---------------------- | ---------------------------------------- | --------- | ---------------------------------------- |
| builder | CustomDialog | Yes | Constructor of the custom dialog box content. |
| cancel | () =&gt; void | No | Callback invoked when the dialog box is closed after the overlay exits. |
| autoCancel | boolean | No | Whether to allow users to click the overlay to exit.<br>Default value: **true** |
| alignment | [DialogAlignment](#dialogalignment) | No | Alignment mode of the dialog box in the vertical direction.<br>Default value: **DialogAlignment.Default** |
| offset | {<br>dx: Length \| [Resource](ts-types.md#resource),<br>dy: Length \| [Resource](ts-types.md#resource)<br>} | No | Offset of the dialog box relative to the alignment position.|
| offset | {<br>dx: Length \| [Resource](ts-types.md#resource),<br>dy: Length \| [Resource](ts-types.md#resource)<br>} | No | Offset of the dialog box relative to the alignment position. |
| customStyle | boolean | No | Whether to use a custom style for the dialog box.<br>Default value: **false** |
| gridCount<sup>8+</sup> | number | No | Number of grid columns occupied by the dialog box. |
## DialogAlignment
| Name | Description |
| ------------------------ | ------- |
| Top | Vertical top alignment.|
| Center | Vertical center alignment.|
| Bottom | Vertical bottom alignment.|
| ------------------------ | -------------------------- |
| Top | Vertical top alignment. |
| Center | Vertical center alignment. |
| Bottom | Vertical bottom alignment. |
| Default | Default alignment. |
| TopStart<sup>8+</sup> | Top left alignment. |
| TopEnd<sup>8+</sup> | Top right alignment. |
......
......@@ -13,21 +13,21 @@ show(options?: TextPickerDialogOptions)
Shows a text picker in the given settings.
- TextPickerDialogOptions
| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- |
| range | string[] \| [Resource](../../ui/ts-types.md#resource)| Yes| - | Data selection range of the picker.|
| selected | number | No| 0 | Index of the selected item in the range.|
| value | string | No | - | Value of the selected item. This parameter does not take effect when the **selected** parameter is set. If the value is not within the range, the first item in the range is used instead.|
| defaultPickerItemHeight | number \| string | No| - | Default height of an item in the picker.|
| onAccept | (value: TextPickerResult) => void | No| - | Callback invoked when the OK button in the dialog box is clicked.|
| onCancel | () => void | No| - | Callback invoked when the Cancel button in the dialog box is clicked.|
| onChange | (value: TextPickerResult) => void | No| - | Callback invoked when the selected item in the picker changes.|
| Name | Type | Mandatory | Default Value | Description |
| ----------------------- | ---------------------------------------- | --------- | ------------- | ---------------------------------------- |
| range | string[] \| [Resource](ts-types.md#resource) | Yes | - | Data selection range of the picker. |
| selected | number | No | 0 | Index of the selected item in the range. |
| value | string | No | - | Value of the selected item. This parameter does not take effect when the **selected** parameter is set. If the value is not within the range, the first item in the range is used instead. |
| defaultPickerItemHeight | number \| string | No | - | Default height of an item in the picker. |
| onAccept | (value: TextPickerResult) => void | No | - | Callback invoked when the OK button in the dialog box is clicked. |
| onCancel | () => void | No | - | Callback invoked when the Cancel button in the dialog box is clicked. |
| onChange | (value: TextPickerResult) => void | No | - | Callback invoked when the selected item in the picker changes. |
- TextPickerResult
| Name| Type| Description|
| -------- | -------- | -------- |
| value | string | Value of the selected item.|
| index | number | Index of the selected item in the range.|
| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
| value | string | Value of the selected item. |
| index | number | Index of the selected item in the range. |
## Example
......
......@@ -70,7 +70,7 @@ You can create resource group sub-directories (including element, media, animati
**Table 3** Resource group sub-directories
| Resource Group Sub-directory | Description | Resource File |
| ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ---------------------------- | ---------------------------------------- | ---------------------------------------- |
| element | Element resources. Each type of data is represented by a JSON file. The options are as follows:<br>- **boolean**: boolean data<br>- **color**: color data<br>- **float**: floating-point data<br>- **intarray**: array of integer<br>- **integer**: integer data<br>- **pattern**: pattern data<br>- **plural**: plural form data<br>- **strarray**: array of strings<br>- **string**: string data | It is recommended that files in the **element** sub-directory be named the same as the following files, each of which can contain only data of the same type:<br>- boolean.json<br>- color.json<br>- float.json<br>- intarray.json<br>- integer.json<br>- pattern.json<br>- plural.json<br>- strarray.json<br>- string.json |
| media | Media resources, including non-text files such as images, audios, and videos. | The file name can be customized, for example, **icon.png**. |
| profile | Other types of files, which are stored in their raw formats. | The file name can be customized. |
......@@ -79,8 +79,8 @@ You can create resource group sub-directories (including element, media, animati
**Table 4** Image resource types
| Format| File Name Extension|
| -------- | -------- |
| Format | File Name Extension |
| ------ | ------------------- |
| JPEG | .jpg |
| PNG | .png |
| GIF | .gif |
......@@ -89,8 +89,8 @@ You can create resource group sub-directories (including element, media, animati
| BMP | .bmp |
**Table 5** Audio and video resource types
| Format| File Name Extension|
| -------- | -------- |
| Format | File Name Extension |
| ------------------------------------ | ------------------- |
| H.263 | .3gp <br>.mp4 |
| H.264 AVC <br> Baseline Profile (BP) | .3gp <br>.mp4 |
| MPEG-4 SP | .3gp |
......
......@@ -180,7 +180,7 @@ systemTime.getCurrentTime(false)和new Date().getTime()一样,都是返回1970
适用于:OpenHarmony SDK3.2.6.5, API9 Stage模型
\@BuilderParam修饰的属性进行赋值时不带参数(如:content: this.specificParam),则此属性的类型需定义成无返回值的函数(如:\@BuilderParam content: () =&gt; void);若带参数(如:callContent: this.specificParam1("111")),则此属性的类型需定义成any(如:\@BuilderParam callContent: any;),具体用法请参考[BuilderParam](../ui/ts-component-based-builder.md)
\@BuilderParam修饰的属性进行赋值时不带参数(如:content: this.specificParam),则此属性的类型需定义成无返回值的函数(如:\@BuilderParam content: () =&gt; void);若带参数(如:callContent: this.specificParam1("111")),则此属性的类型需定义成any(如:\@BuilderParam callContent: any;),具体用法请参考[BuilderParam](../quick-start/arkts-dynamic-ui-elememt-building.md#builderparam8)
## ArkTS如何把string转成byte数组
......
......@@ -11,7 +11,7 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | --------------------- |
| ohos.i18n | getSystemLanguage():string | 获取系统语言。 |
| ohos.i18n | getSystemRegion():string | 获取系统区域。 |
| ohos.i18n | getSystemLocale():string | 获取系统Locale。 |
......@@ -91,7 +91,7 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | --------------------- |
| ohos.i18n | getCalendar(locale:string,type?:string):Calendar<sup>8+</sup> | 获取指定locale和type的日历对象。 |
| ohos.i18n | setTime(date:Date): void<sup>8+</sup> | 设置日历对象内部的时间日期。 |
| ohos.i18n | setTime(time:number): void<sup>8+</sup> | 设置日历对象内部的时间日期。 |
......@@ -183,7 +183,7 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | ----------------------- |
| ohos.i18n | constructor(country:string,options?:PhoneNumberFormatOptions)<sup>8+</sup> | 实例化PhoneNumberFormat对象。 |
| ohos.i18n | isValidNumber(number:string):boolean<sup>8+</sup> | 判断number是否是一个格式正确的电话号码。 |
| ohos.i18n | format(number:string):string<sup>8+</sup> | 对number按照指定国家及风格进行格式化。 |
......@@ -221,14 +221,14 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | --------------------------------------- |
| ohos.i18n | unitConvert(fromUnit:UnitInfo,toUnit:UnitInfo,value:number,locale:string,style?:string):string<sup>8+</sup> | 将fromUnit的单位转换为toUnit的单位,并根据区域与风格进行格式化。 |
### 开发步骤
1. 度量衡单位转换。
调用[unitConvert](../reference/apis/js-apis-i18n.md#unitconvert8)方法实现度量衡单位转换,并进行格式化显示的功能。
调用[unitConvert](../reference/apis/js-apis-i18n.md#unitconvert9)方法实现度量衡单位转换,并进行格式化显示的功能。
```js
var fromUnit = {unit: "cup", measureSystem: "US"};
......@@ -246,7 +246,7 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | ----------------------- |
| ohos.i18n | getInstance(locale?:string):IndexUtil<sup>8+</sup> | 实例化字母表索引对象。 |
| ohos.i18n | getIndexList():Array&lt;string&gt;<sup>8+</sup> | 获取当前Locale的索引列表。 |
| ohos.i18n | addLocale(locale:string): void<sup>8+</sup> | 将新的Locale对应的索引加入当前索引列表。 |
......@@ -295,7 +295,7 @@
### 接口说明
| 模块 | 接口名称 | 描述 |
| -------- | -------- | -------- |
| --------- | ---------------------------------------- | ------------------------------ |
| ohos.i18n | getLineInstance(locale:string):BreakIterator<sup>8+</sup> | 实例化断行对象。 |
| ohos.i18n | setLineBreakText(text:string): void<sup>8+</sup> | 设置要处理的文本。 |
| ohos.i18n | getLineBreakText():string<sup>8+</sup> | 获取要处理的文本。 |
......
......@@ -30,7 +30,7 @@ matchMediaSync(condition: string): MediaQueryListener
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ---------------------------------------- |
| condition | string | 是 | 媒体事件的匹配条件,具体可参考[媒体查询语法规则](../../ui/ui-ts-layout-mediaquery.md#媒体查询条件语法规则)。 |
| condition | string | 是 | 媒体事件的匹配条件,具体可参考[媒体查询语法规则](../../ui/ui-ts-layout-mediaquery.md#语法规则)。 |
**返回值:**
| 类型 | 说明 |
......
......@@ -63,9 +63,9 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
| 名称 | 参数 | 描述 |
| -------------- | ---------------------------------------- | ------------------------- |
| complete(Rich) | {<br>&nbsp;width:width,<br>&nbsp;height:height<br>&nbsp;} | 图片成功加载时触发该回调,返回成功加载的图源尺寸。 |
| error(Rich) | {<br>&nbsp;width:width,<br>&nbsp;height:height<br>&nbsp;} | 图片加载出现异常时触发该回调,异常时长宽为零。 |
| -------- | ---------------------------------------- | ------------------------- |
| complete | {<br>&nbsp;width:width,<br>&nbsp;height:height<br>&nbsp;} | 图片成功加载时触发该回调,返回成功加载的图源尺寸。 |
| error | {<br>&nbsp;width:width,<br>&nbsp;height:height<br>&nbsp;} | 图片加载出现异常时触发该回调,异常时长宽为零。 |
## 方法
......
......@@ -45,10 +45,10 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
| 名称 | 参数 | 描述 |
| ------------ | ---- | ---------------------------------------- |
| bounce(Rich) | - | 当文本滚动到末尾时触发该事件。 |
| finish(Rich) | - | 当完成滚动次数时触发该事件。需要在&nbsp;loop&nbsp;属性值大于&nbsp;0&nbsp;时触发。 |
| start(Rich) | - | 当文本滚动开始时触发该事件。 |
| ------ | ---- | ---------------------------------------- |
| bounce | - | 当文本滚动到末尾时触发该事件。 |
| finish | - | 当完成滚动次数时触发该事件。需要在&nbsp;loop&nbsp;属性值大于&nbsp;0&nbsp;时触发。 |
| start | - | 当文本滚动开始时触发该事件。 |
## 方法
......
......@@ -34,15 +34,15 @@
除支持[通用样式](../arkui-js/js-components-common-styles.md)外,还支持如下样式:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| ------------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| texton-color(Rich) | &lt;color&gt; | \#000000 | 否 | 选中时显示的文本颜色,仅设置texton和textoff生效。 |
| textoff-color(Rich) | &lt;color&gt; | \#000000 | 否 | 未选中时显示的文本颜色,仅设置texton和textoff生效。 |
| text-padding(Rich) | number | 0px | 否 | texton/textoff中最长文本两侧距离滑块边界的距离。 |
| font-size(Rich) | &lt;length&gt; | - | 否 | 文本尺寸,仅设置texton和textoff生效。 |
| allow-scale(Rich) | boolean | true | 否 | 文本尺寸是否跟随系统设置字体缩放尺寸进行放大缩小。<br/>如果在config描述文件中针对ability配置了fontSize的config-changes标签,则应用不会重启而直接生效。 |
| font-style(Rich) | string | normal | 否 | 字体样式,仅设置texton和textoff生效。见text组件[font-style的样式属性](../arkui-js/js-components-basic-text.md#样式)。 |
| font-weight(Rich) | number&nbsp;\|&nbsp;string | normal | 否 | 字体粗细,仅设置texton和textoff生效。见text组件的[font-weight的样式属性](../arkui-js/js-components-basic-text.md#样式)。 |
| font-family(Rich) | string | sans-serif | 否 | 字体列表,用逗号分隔,每个字体用字体名或者字体族名设置。列表中第一个系统中存在的或者通过[自定义字体](../arkui-js/js-components-common-customizing-font.md)指定的字体,会被选中作为文本的字体。仅设置texton和textoff生效。 |
| ------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| texton-color | &lt;color&gt; | \#000000 | 否 | 选中时显示的文本颜色,仅设置texton和textoff生效。 |
| textoff-color | &lt;color&gt; | \#000000 | 否 | 未选中时显示的文本颜色,仅设置texton和textoff生效。 |
| text-padding | number | 0px | 否 | texton/textoff中最长文本两侧距离滑块边界的距离。 |
| font-size | &lt;length&gt; | - | 否 | 文本尺寸,仅设置texton和textoff生效。 |
| allow-scale | boolean | true | 否 | 文本尺寸是否跟随系统设置字体缩放尺寸进行放大缩小。<br/>如果在config描述文件中针对ability配置了fontSize的config-changes标签,则应用不会重启而直接生效。 |
| font-style | string | normal | 否 | 字体样式,仅设置texton和textoff生效。见text组件[font-style的样式属性](../arkui-js/js-components-basic-text.md#样式)。 |
| font-weight | number&nbsp;\|&nbsp;string | normal | 否 | 字体粗细,仅设置texton和textoff生效。见text组件的[font-weight的样式属性](../arkui-js/js-components-basic-text.md#样式)。 |
| font-family | string | sans-serif | 否 | 字体列表,用逗号分隔,每个字体用字体名或者字体族名设置。列表中第一个系统中存在的或者通过[自定义字体](../arkui-js/js-components-common-customizing-font.md)指定的字体,会被选中作为文本的字体。仅设置texton和textoff生效。 |
## 事件
......
......@@ -51,7 +51,7 @@ OpenHarmony提供了九种后台模式,供需要在后台做长时任务的业
**表1** 长时任务种类
| 后台模式 | 说明 | 通知栏显示提示 | 备注 |
| -------- | -------- | -------- | -------- |
| --------------------- | ------------------------- | ------------ | ------------------------- |
| dataTransfer | 通过网络/对端设备进行数据下载、备份、分享、传输等 | 正在运行数据传输任务 | - |
| audioPlayback | 音频输出 | 正在运行音频播放任务 | - |
| audioRecording | 音频输入 | 正在运行录音任务 | - |
......@@ -80,14 +80,14 @@ OpenHarmony提供了九种后台模式,供需要在后台做长时任务的业
- **执行频率**:系统会根据应用的活跃度对延迟任务做分级管控,限制延迟任务调度的执行频率。对于通过能效资源接口申请了WORK_SCHEDULER资源的应用,在资源的有效期内,它的延迟任务执行频率不受限制。
| 应用分组 | 延迟任务执行频率约束 |
| --------------------|------------------------- |
| ---------------------------------------- | ---------- |
| 活跃 | 最小间隔2小时 |
| 每日使用 | 最小间隔4小时 |
| 经常使用 | 最小间隔24小时 |
| 不经常使用 | 最小间隔48小时 |
| 受限分组 | 禁止 |
| 未使用分组 | 禁止 |
| [能效资源豁免分组](../reference/apis/js-apis-backgroundTaskManager.md#resourcetype9) | 执行频率不受限制 |
| [能效资源豁免分组](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#resourcetype) | 执行频率不受限制 |
- **WorkInfo设置参数约束**
......@@ -112,7 +112,7 @@ OpenHarmony提供了九种后台模式,供需要在后台做长时任务的业
**表1** 能效资源种类
| 参数名 | 参数值 | 描述 |
| ----------------------- | ---- | --------------------- |
| -------------- | ---- | ------------------- |
| CPU | 1 | CPU资源,申请后不被挂起 |
| COMMON_EVENT | 2 | 公共事件,申请后挂起状态下不被代理掉 |
| TIMER | 4 | 计时器,申请后挂起状态下不被代理掉 |
......
......@@ -11,8 +11,8 @@
**表1** 申请能效资源主要接口
| 接口名 | 描述 |
| ---------------------------------------- | ---------------------------------------- |
| applyEfficiencyResources(request: [EfficiencyResourcesRequest](../reference/apis/js-apis-backgroundTaskManager.md#efficiencyresourcesrequest9)): boolean | 申请能效资源。 |
| ---------------------------------------- | ---------- |
| applyEfficiencyResources(request: [EfficiencyResourcesRequest](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#efficiencyresourcesrequest)): boolean | 申请能效资源。 |
| resetAllEfficiencyResources():void | 释放申请的能效资源。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册