提交 25ccf8d8 编写于 作者: H HelloCrease

update docs

Signed-off-by: NHelloCrease <lian15@huawei.com>
上级 21a6a4a2
......@@ -21,9 +21,9 @@ import sensor from '@system.sensor';
## Error Codes
| Error Code | Description |
| ---- | -------------- |
| 900 | The current device does not support the corresponding sensor.|
| Error Code | Description |
| ---------- | ---------------------------------------- |
| 900 | The current device does not support the corresponding sensor. |
## sensor.subscribeAccelerometer
......@@ -37,19 +37,19 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the acceleration sensor data changes. |
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the acceleration sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| ---- | ------ | ------- |
| x | number | Acceleration on the x-axis.|
| y | number | Acceleration on the y-axis.|
| z | number | Acceleration on the z-axis.|
| Name | Type | Description |
| ---- | ------ | --------------------------- |
| x | number | Acceleration on the x-axis. |
| y | number | Acceleration on the y-axis. |
| z | number | Acceleration on the z-axis. |
**Example**
......@@ -97,16 +97,16 @@ Subscribes to data changes of the compass sensor. If this API is called multiple
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | --------------- |
| success | Function | Yes | Called when the compass sensor data changes.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the compass sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| --------- | ------ | ---------- |
| direction | number | Direction of the device, in degrees.|
| Name | Type | Description |
| --------- | ------ | ------------------------------------ |
| direction | number | Direction of the device, in degrees. |
**Example**
......@@ -149,16 +149,16 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ----------------- |
| success | Function | Yes | Called when the proximity sensor data changes.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the proximity sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| -------- | ------ | --------------------- |
| distance | number | Distance between a visible object and the device screen.|
| Name | Type | Description |
| -------- | ------ | ---------------------------------------- |
| distance | number | Distance between a visible object and the device screen. |
**Example**
......@@ -201,16 +201,16 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | --------------- |
| success | Function | Yes | Called when the ambient light sensor data changes|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the ambient light sensor data changes |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| --------- | ------ | ------------ |
| intensity | number | Light intensity, in lux.|
| Name | Type | Description |
| --------- | ------ | ------------------------ |
| intensity | number | Light intensity, in lux. |
**Example**
......@@ -255,16 +255,16 @@ Subscribes to data changes of the step counter sensor. If this API is called mul
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ---------------- |
| success | Function | Yes | Called when the step counter sensor data changes.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the step counter sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| ----- | ------ | --------------------- |
| steps | number | Number of counted steps after the sensor is restarted.<br>|
| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
| steps | number | Number of counted steps after the sensor is restarted.<br> |
**Example**
......@@ -302,7 +302,7 @@ sensor.unsubscribeStepCounter();
## sensor.subscribeBarometer
subcribeBarometer(Object): void
subscribeBarometer(Object): void
Subscribes to data changes of the barometer sensor. If this API is called multiple times for the same application, the last call takes effect.
......@@ -310,16 +310,16 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ---------------- |
| success | Function | Yes | Called when the barometer sensor data changes.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the barometer sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| -------- | ------ | ----------- |
| pressure | number | Pressure, in pascal.|
| Name | Type | Description |
| -------- | ------ | -------------------- |
| pressure | number | Pressure, in pascal. |
**Example**
......@@ -366,16 +366,16 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ------------------------- |
| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| --------- | ------ | ---- |
| heartRate | number | Heart rate.|
| Name | Type | Description |
| --------- | ------ | ----------- |
| heartRate | number | Heart rate. |
**Example**
......@@ -421,16 +421,16 @@ Subscribes to changes of the wearing state of a wearable device. If this API is
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ------------- |
| success | Function | Yes | Called when the wearing state changes.|
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | -------------------------------------- |
| success | Function | Yes | Called when the wearing state changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| ----- | ------- | ------ |
| value | boolean | Whether the wearable device is worn.|
| Name | Type | Description |
| ----- | ------- | ------------------------------------ |
| value | boolean | Whether the wearable device is worn. |
**Example**
......@@ -473,17 +473,17 @@ Obtains the wearing state of a wearable device.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ------------ |
| success | Function | No | Callback upon success.|
| fail | Function | No | Callback upon failure.|
| complete | Function | No | Called when the execution is complete.|
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | -------------------------------------- |
| success | Function | No | Callback upon success. |
| fail | Function | No | Callback upon failure. |
| complete | Function | No | Called when the execution is complete. |
Return values of the success callback
| Name | Type | Description |
| ----- | ------- | ------ |
| value | boolean | Whether the wearable device is worn.|
| Name | Type | Description |
| ----- | ------- | ------------------------------------ |
| value | boolean | Whether the wearable device is worn. |
**Example**
......@@ -510,18 +510,18 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the device orientation sensor data changes. |
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the device orientation sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
| alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth.|
| beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth.|
| gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth.|
| alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth. |
| beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth. |
| gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth. |
**Example**
......@@ -571,19 +571,19 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the gyroscope sensor data changes. |
| fail | Function | No | Callback upon failure. |
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the gyroscope sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name | Type | Description |
| ---- | ------ | --------- |
| x | number | Rotation angular velocity of the X axis.|
| y | number | Rotation angular velocity of the Y axis.|
| z | number | Rotation angular velocity of the Z axis.|
| Name | Type | Description |
| ---- | ------ | ---------------------------------------- |
| x | number | Rotation angular velocity of the X axis. |
| y | number | Rotation angular velocity of the Y axis. |
| z | number | Rotation angular velocity of the Z axis. |
**Example**
......
......@@ -20,44 +20,44 @@ Not supported
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| -------------------------------- | ----------------------- | --------- | ---- | ---------------------------------------- |
| type | string | text<br>| No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**.<br>The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified.<br>The **button**, **checkbox**, and **radio** types cannot be dynamically modified. <br>- **button**: a button that can be clicked.<br>- **checkbox**: a check box.<br>- **radio**: a radio button that allows users to select one from multiple others with the same name.<br>- **text**: a single-line text field.<br>- **email**: a field used for an email address.<br>- **date**: date component, including the year, month, and day, but excluding time.<br>- **time**: time component, without the time zone.<br>- **number**: field for entering digits.<br>- **password**: password field, in which characters will be shielded.|
| checked | boolean | false | No | Whether the **\<input>** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
| name | string | - | No | Name of the **\<input>** component.<br>This attribute is mandatory when **type** is set to **radio**. |
| value | string | - | No | Value of the **\<input>** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name.|
| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**.|
| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated.<br>Available values include:<br>- default<br>- next<br>- go<br>- done<br>- send<br>- search<br>Except for the **next** type, clicking the Enter key hides the soft keyboard.|
| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG.|
| showcounter<sup>5+</sup> | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
| menuoptions<sup>5+</sup> | Array&lt;MeunOption&gt; | - | No | Menu options displayed after users click the **More** button. |
| autofocus<sup>6+</sup> | boolean | false | No | Whether to automatically obtain focus.<br>This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**.|
| selectedstart<sup>6+</sup> | number | -1 | No | Start position for text selection. |
| selectedend<sup>6+</sup> | number | -1 | No | End position for text selection. |
| softkeyboardenabled<sup>6+</sup> | boolean | true | No | Whether to display the soft keyboard during editing. |
| showpasswordicon<sup>6+</sup> | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
| Name | Type | Default Value | Mandatory | Description |
| -------------------------------- | ----------------------- | ------------- | --------- | ---------------------------------------- |
| type | string | text<br> | No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**.<br>The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified.<br>The **button**, **checkbox**, and **radio** types cannot be dynamically modified. <br>- **button**: a button that can be clicked.<br>- **checkbox**: a check box.<br>- **radio**: a radio button that allows users to select one from multiple others with the same name.<br>- **text**: a single-line text field.<br>- **email**: a field used for an email address.<br>- **date**: date component, including the year, month, and day, but excluding time.<br>- **time**: time component, without the time zone.<br>- **number**: field for entering digits.<br>- **password**: password field, in which characters will be shielded. |
| checked | boolean | false | No | Whether the **\<input>** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
| name | string | - | No | Name of the **\<input>** component.<br>This attribute is mandatory when **type** is set to **radio**. |
| value | string | - | No | Value of the **\<input>** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name. |
| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**. |
| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated.<br>Available values include:<br>- default<br>- next<br>- go<br>- done<br>- send<br>- search<br>Except for the **next** type, clicking the Enter key hides the soft keyboard. |
| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG. |
| showcounter<sup>5+</sup> | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
| menuoptions<sup>5+</sup> | Array&lt;MenuOption&gt; | - | No | Menu options displayed after users click the **More** button. |
| autofocus<sup>6+</sup> | boolean | false | No | Whether to automatically obtain focus.<br>This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**. |
| selectedstart<sup>6+</sup> | number | -1 | No | Start position for text selection. |
| selectedend<sup>6+</sup> | number | -1 | No | End position for text selection. |
| softkeyboardenabled<sup>6+</sup> | boolean | true | No | Whether to display the soft keyboard during editing. |
| showpasswordicon<sup>6+</sup> | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
**Table 1** MenuOption<sup>5+</sup>
| Name | Type | Description |
| ------- | ------ | ----------- |
| icon | string | Path of the icon for a menu option.|
| content | string | Text content of a menu option.|
| Name | Type | Description |
| ------- | ------ | ----------------------------------- |
| icon | string | Path of the icon for a menu option. |
| content | string | Text content of a menu option. |
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------------------------ | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | \#e6000000 | No | Font color of the single-line text box or button. |
| font-size | &lt;length&gt; | 16px | No | Font size of the single-line text box or button. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| placeholder-color | &lt;color&gt; | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md) component. |
| caret-color<sup>6+</sup> | &lt;color&gt; | - | No | Color of the caret. |
| Name | Type | Default Value | Mandatory | Description |
| ------------------------ | ---------------- | ------------- | --------- | ---------------------------------------- |
| color | &lt;color&gt; | \#e6000000 | No | Font color of the single-line text box or button. |
| font-size | &lt;length&gt; | 16px | No | Font size of the single-line text box or button. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart. |
| placeholder-color | &lt;color&gt; | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md) component. |
| caret-color<sup>6+</sup> | &lt;color&gt; | - | No | Color of the caret. |
## Events
......@@ -65,31 +65,31 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
- When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the following events are supported.
| Name | Parameter | Description |
| Name | Parameter | Description |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
| change | {<br> value: inputValue<br> } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned.<br>If you change the **value** attribute directly, this event will not be triggered.|
| enterkeyclick | {<br> value: enterKey<br> } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows:<br>- **2**: returned if **enterkeytype** is **go**.<br>- **3**: returned if **enterkeytype** is **search**.<br>- **4**: returned if **enterkeytype** is **send**.<br>- **5**: returned if **enterkeytype** is **next**.<br>- **6**: returned if **enterkeytype** is **default**, **done**, or is not set.|
| translate<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned.|
| share<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned.|
| search<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned.|
| optionselect<sup>5+</sup> | {<br> index: optionIndex,<br> value: selectedText<br> } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned.|
| selectchange<sup>6+</sup> | {<br>start: number,<br>end: number<br> } | Triggered when the text selection changes. |
| change | {<br> value: inputValue<br> } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned.<br>If you change the **value** attribute directly, this event will not be triggered. |
| enterkeyclick | {<br> value: enterKey<br> } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows:<br>- **2**: returned if **enterkeytype** is **go**.<br>- **3**: returned if **enterkeytype** is **search**.<br>- **4**: returned if **enterkeytype** is **send**.<br>- **5**: returned if **enterkeytype** is **next**.<br>- **6**: returned if **enterkeytype** is **default**, **done**, or is not set. |
| translate<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned. |
| share<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned. |
| search<sup>5+</sup> | {<br> value: selectedText<br> } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned. |
| optionselect<sup>5+</sup> | {<br> index: optionIndex,<br> value: selectedText<br> } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned. |
| selectchange<sup>6+</sup> | {<br>start: number,<br>end: number<br> } | Triggered when the text selection changes. |
- When **type** is set to **checkbox** or **radio**, the following events are supported.
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ---------------------------------------- |
| change | {<br> checked:true \| false <br>} | Triggered when the checked status of the **checkbox** or **radio** button changes.|
| Name | Parameter | Description |
| ------ | --------------------------------- | ---------------------------------------- |
| change | {<br> checked:true \| false <br>} | Triggered when the checked status of the **checkbox** or **radio** button changes. |
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name | Parameter | Description |
| Name | Parameter | Description |
| ------------------- | ---------------------------------------- | ---------------------------------------- |
| focus | {<br> focus: true\|false<br> }:<br>If **focus** is not passed, the default value **true** is used.| Obtains or loses focus. When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the input method can be displayed or collapsed. |
| showError | {<br> error: string <br>} | Displays the error message. This method is available when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
| focus | {<br> focus: true\|false<br> }:<br>If **focus** is not passed, the default value **true** is used. | Obtains or loses focus. When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the input method can be displayed or collapsed. |
| showError | {<br> error: string <br>} | Displays the error message. This method is available when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
| delete<sup>6+</sup> | - | Deletes text based on the current caret position when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**; deletes the last character and displays the caret if the current input component does not have a caret. |
## Example
......
......@@ -3,17 +3,17 @@
> **NOTE**
>
> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
>
> - Set **configChanges** under **abilities** in the **config.json** file to **orientation**.
> ```
> "abilities": [
> {
> "configChanges": ["orientation"],
> ...
> }
> ]
> ```
> - Set **configChanges** under **abilities** in the **config.json** file to **orientation**.
> ```
> "abilities": [
> {
> "configChanges": ["orientation"],
> ...
> }
> ]
> ```
The **\<video>** component provides a video player.
......@@ -27,54 +27,54 @@ Not supported
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| muted | boolean | false | No| Whether the video is muted.|
| src | string | - | No| Path of the video content to play.|
| autoplay | boolean | false | No| Whether the video is played automatically after being rendered.|
| controls | boolean | true | No| Whether the control bar is displayed during video playback. If the value is set to **false**, the control bar is not displayed. The default value is **true**, indicating that the platform can either show or hide the control bar.|
| Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | ------------- | --------- | ---------------------------------------- |
| muted | boolean | false | No | Whether the video is muted. |
| src | string | - | No | Path of the video content to play. |
| autoplay | boolean | false | No | Whether the video is played automatically after being rendered. |
| controls | boolean | true | No | Whether the control bar is displayed during video playback. If the value is set to **false**, the control bar is not displayed. The default value is **true**, indicating that the platform can either show or hide the control bar. |
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| object-fit | string | contain | No| Video scale type. If **poster** has been assigned a value, the setting of this style will affect the scaling type of the video poster. For details, see object-fit enums.|
| Name | Type | Default Value | Mandatory | Description |
| ---------- | ------ | ------------- | --------- | ---------------------------------------- |
| object-fit | string | contain | No | Video scale type. If **poster** has been assigned a value, the setting of this style will affect the scaling type of the video poster. For details, see object-fit enums. |
**Table 1** object-fit enums
| Type| Description|
| -------- | -------- |
| fill | The image is resized to fill the display area, and its aspect ratio is not retained.|
| Type | Description |
| ---- | ---------------------------------------- |
| fill | The image is resized to fill the display area, and its aspect ratio is not retained. |
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| prepared | {&nbsp;duration:&nbsp;value&nbsp;}<sup>5+</sup> | Triggered when the video preparation is complete. The video duration (in seconds) is obtained from **duration**.|
| start | - | Triggered when the video is played.|
| pause | - | Triggered when the video playback is paused.|
| finish | - | Triggered when the video playback is finished.|
| error | - | Triggered when the video playback fails.|
| seeking | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered to report the time (in seconds) when the progress bar is being dragged.|
| seeked | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered to report the playback time (in seconds) when the user finishes dragging the progress bar.|
| timeupdate | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered once per 250 ms when the playback progress changes. The unit of the current playback time is second.|
| Name | Parameter | Description |
| ---------- | ---------------------------------------- | ---------------------------------------- |
| prepared | {&nbsp;duration:&nbsp;value&nbsp;}<sup>5+</sup> | Triggered when the video preparation is complete. The video duration (in seconds) is obtained from **duration**. |
| start | - | Triggered when the video is played. |
| pause | - | Triggered when the video playback is paused. |
| finish | - | Triggered when the video playback is finished. |
| error | - | Triggered when the video playback fails. |
| seeking | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered to report the time (in seconds) when the progress bar is being dragged. |
| seeked | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered to report the playback time (in seconds) when the user finishes dragging the progress bar. |
| timeupdate | {&nbsp;currenttime:&nbsp;value&nbsp;} | Triggered once per 250 ms when the playback progress changes. The unit of the current playback time is second. |
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| start | - | Starts playing a video.|
| pause | - | Pauses a video.|
| setCurrentTime | {&nbsp;currenttime:&nbsp;value&nbsp;} | Sets the video playback position, in seconds.|
| Name | Parameter | Description |
| -------------- | ------------------------------------- | ---------------------------------------- |
| start | - | Starts playing a video. |
| pause | - | Pauses a video. |
| setCurrentTime | {&nbsp;currenttime:&nbsp;value&nbsp;} | Sets the video playback position, in seconds. |
> **NOTE**
>
......@@ -87,7 +87,7 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
<div class="container">
<video id='videoId' src='/common/myDeram.mp4' muted='false' autoplay='false'
controls='true' onprepared='preparedCallback' onstart='startCallback'
onpaues='pauesCallback' onfinish='finishCallback' onerror='errorCallback'
onpause='pauseCallback' onfinish='finishCallback' onerror='errorCallback'
onseeking='seekingCallback' onseeked='seekedCallback'
ontimeupdate='timeupdateCallback'
style="object-fit:fill; width:80%; height:400px;"
......
......@@ -22,10 +22,10 @@ setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
| visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标显示或隐藏成功,err为undefined,否则为错误对象。 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ---------------------------------------- |
| visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标显示或隐藏成功,err为undefined,否则为错误对象。 |
**示例**
......@@ -49,14 +49,14 @@ setPointerVisible(visible: boolean): Promise&lt;void&gt;
**参数**
| 参数 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | ------------------------------------------------------------------- |
| visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 |
| 参数 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | ---------------------------------------- |
| visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 |
**返回值**
| 参数 | 说明 |
| ------------------- | ------------------------------- |
| 参数 | 说明 |
| ------------------- | ------------------- |
| Promise&lt;void&gt; | Promise实例,用于异步获取结果。 |
**示例**
......@@ -79,9 +79,9 @@ isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数,异步返回查询结果。 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | -------------- |
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数,异步返回查询结果。 |
**示例**
......@@ -101,8 +101,8 @@ isPointerVisible(): Promise&lt;boolean&gt;
**返回值**
| 参数 | 说明 |
| ---------------------- | ------------------------------- |
| 参数 | 说明 |
| ---------------------- | ------------------- |
| Promise&lt;boolean&gt; | Promise实例,用于异步获取结果。 |
**示例**
......@@ -123,10 +123,10 @@ setPointerSpeed(speed: number, callback: AsyncCallback&lt;void&gt;): void
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标速度成功,err为undefined,否则为错误对象。 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标速度成功,err为undefined,否则为错误对象。 |
**示例**
......@@ -150,14 +150,14 @@ setPointerSpeed(speed: number): Promise&lt;void&gt;
**参数**
| 参数 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | ------------------------------------------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
| 参数 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
**返回值**
| 参数 | 说明 |
| ------------------- | ------------------------------- |
| 参数 | 说明 |
| ------------------- | ---------------- |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例**
......@@ -180,9 +180,9 @@ getPointerSpeed(callback: AsyncCallback&lt;number&gt;): void
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数,异步返回查询结果。 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | -------------- |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数,异步返回查询结果。 |
**示例**
......@@ -202,8 +202,8 @@ getPointerSpeed(): Promise&lt;number&gt;
**返回值**
| 参数 | 说明 |
| ---------------------- | ------------------------------- |
| 参数 | 说明 |
| --------------------- | ------------------- |
| Promise&lt;number&gt; | Promise实例,用于异步获取结果。 |
**示例**
......@@ -224,10 +224,10 @@ getPointerStyle(windowId: number, callback: AsyncCallback&lt;PointerStyle&gt;):
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| callback | AsyncCallback&lt;[PointerStyle](#pointerstyle9)&gt; | 是 | 回调函数,异步返回查询结果。|
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | -------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| callback | AsyncCallback&lt;[PointerStyle](#pointerstyle9)&gt; | 是 | 回调函数,异步返回查询结果。 |
**示例**
......@@ -256,9 +256,9 @@ getPointerStyle(windowId: number): Promise&lt;PointerStyle&gt;
**参数**
| 参数 | 说明 |
| -------- | --------------------------------- |
| Promise&lt;[PointerStyle](#pointerstyle9)&gt; |Promise实例,用于异步获取结果。|
| 参数 | 说明 |
| ---------------------------------------- | ------------------- |
| Promise&lt;[PointerStyle](#pointerstyle9)&gt; | Promise实例,用于异步获取结果。 |
**示例**
......@@ -288,11 +288,11 @@ setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCal
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------| ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置样式成功,err为undefined,否则为错误对象。|
| 参数 | 类型 | 必填 | 说明 |
| ------------ | ------------------------------ | ---- | ----------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置样式成功,err为undefined,否则为错误对象。 |
**示例**
......@@ -320,11 +320,11 @@ setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise&lt;void&g
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| Promise&lt;void&gt; | void | 是 |无返回结果的Promise对象。 |
| 参数 | 类型 | 必填 | 说明 |
| ------------------- | ------------------------------ | ---- | ---------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| Promise&lt;void&gt; | void | 是 | 无返回结果的Promise对象。 |
**示例**
......@@ -348,46 +348,46 @@ window.getTopWindow((err, data) => {
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
| 名称 | 值 | 说明 |
| ------------------- | ---- | --------- |
| DEFAULT | 0 | 默认 |
| EAST | 1 | 向东箭头 |
| WEST | 2 | 向西箭头|
| SOUTH | 3 | 向南箭头 |
| NORTH | 4 | 向北箭头 |
| WEST_EAST | 5 | 向西东箭头 |
| NORTH_SOUTH | 6 | 向北南箭头 |
| NORTH_EAST | 7 | 向东北箭头 |
| NORTH_WEST | 8 | 向西北箭头 |
| SOUTH_EAST | 9 | 向东南箭头 |
| SOUTH_WEST | 10 | 向西南箭头 |
| NORTH_EAST_SOUTH_WEST | 11 | 东北西南调整 |
| NORTH_WEST_SOUTH_EAST | 12 | 西北东南调整 |
| CROSS | 13 | 准确选择 |
| CURSOR_COPY | 14 | 拷贝 |
| CURSOR_FORBID | 15 | 不可用 |
| COLOR_SUCKER | 16 | 滴管 |
| HAND_GRABBING | 17 | 并拢的手 |
| HAND_OPEN | 18 | 张开的手 |
| HAND_POINTING | 19 | 手形指针 |
| HELP | 20 | 帮助选择 |
| MOVE | 21 | 移动 |
| RESIZE_LEFT_RIGHT | 22 | 内部左右调整 |
| RESIZE_UP_DOWN | 23 | 内部上下调整 |
| SCREENSHOT_CHOOSE | 24 | 截图十字准星 |
| SCREENSHOT_CURSOR | 25 | 截图 |
| TEXT_CURSOR | 26 | 文本选择 |
| ZOOM_IN | 27 | 放大 |
| ZOOM_OUT | 28 | 缩小 |
| MIDDLE_BTN_EAST | 29 | 向东滚动 |
| MIDDLE_BTN_WEST | 30 | 向西滚动 |
| MIDDLE_BTN_SOUTH | 31 | 向南滚动 |
| MIDDLE_BTN_NORTH | 32 | 向北滚动 |
| MIDDLE_BTN_NORTH_SOUTH | 33 | 向北南滚动 |
| MIDDLE_BTN_NORTH_EAST | 34 | 向东北滚动 |
| MIDDLE_BTN_NORTH_WEST | 35 | 向西北滚动 |
| MIDDLE_BTN_SOUTH_EAST | 36 | 向东南滚动 |
| MIDDLE_BTN_SOUTH_WEST | 37 | 向西南滚动 |
| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | 四向锥形移动 |
| 名称 | 值 | 说明 |
| -------------------------------- | ---- | ------ |
| DEFAULT | 0 | 默认 |
| EAST | 1 | 向东箭头 |
| WEST | 2 | 向西箭头 |
| SOUTH | 3 | 向南箭头 |
| NORTH | 4 | 向北箭头 |
| WEST_EAST | 5 | 向西东箭头 |
| NORTH_SOUTH | 6 | 向北南箭头 |
| NORTH_EAST | 7 | 向东北箭头 |
| NORTH_WEST | 8 | 向西北箭头 |
| SOUTH_EAST | 9 | 向东南箭头 |
| SOUTH_WEST | 10 | 向西南箭头 |
| NORTH_EAST_SOUTH_WEST | 11 | 东北西南调整 |
| NORTH_WEST_SOUTH_EAST | 12 | 西北东南调整 |
| CROSS | 13 | 准确选择 |
| CURSOR_COPY | 14 | 拷贝 |
| CURSOR_FORBID | 15 | 不可用 |
| COLOR_SUCKER | 16 | 滴管 |
| HAND_GRABBING | 17 | 并拢的手 |
| HAND_OPEN | 18 | 张开的手 |
| HAND_POINTING | 19 | 手形指针 |
| HELP | 20 | 帮助选择 |
| MOVE | 21 | 移动 |
| RESIZE_LEFT_RIGHT | 22 | 内部左右调整 |
| RESIZE_UP_DOWN | 23 | 内部上下调整 |
| SCREENSHOT_CHOOSE | 24 | 截图十字准星 |
| SCREENSHOT_CURSOR | 25 | 截图 |
| TEXT_CURSOR | 26 | 文本选择 |
| ZOOM_IN | 27 | 放大 |
| ZOOM_OUT | 28 | 缩小 |
| MIDDLE_BTN_EAST | 29 | 向东滚动 |
| MIDDLE_BTN_WEST | 30 | 向西滚动 |
| MIDDLE_BTN_SOUTH | 31 | 向南滚动 |
| MIDDLE_BTN_NORTH | 32 | 向北滚动 |
| MIDDLE_BTN_NORTH_SOUTH | 33 | 向北南滚动 |
| MIDDLE_BTN_NORTH_EAST | 34 | 向东北滚动 |
| MIDDLE_BTN_NORTH_WEST | 35 | 向西北滚动 |
| MIDDLE_BTN_SOUTH_EAST | 36 | 向东南滚动 |
| MIDDLE_BTN_SOUTH_WEST | 37 | 向西南滚动 |
| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | 四向锥形移动 |
......@@ -299,7 +299,7 @@ sensor.unsubscribeStepCounter();
## sensor.subscribeBarometer
subcribeBarometer(Object): void
subscribeBarometer(Object): void
订阅气压传感器数据变化。针对同一个应用,多次点击调用时,会覆盖前面的调用效果,即仅最后一次调用生效。
......
......@@ -23,14 +23,14 @@
| -------------------------------- | ----------------------- | --------- | ---- | ---------------------------------------- |
| type | string | text<br/> | 否 | input组件类型,可选值为text,email,date,time,number,password,button,checkbox,radio。<br/>其中text,email,date,time,number,password这六种类型之间支持动态切换修改。<br/>button,checkbox,radio不支持动态修改。可选值定义如下:<br/>-&nbsp;button:定义可点击的按钮;<br/>-&nbsp;checkbox:定义多选框;<br/>-&nbsp;radio:定义单选按钮,允许在多个拥有相同name值的选项中选中其中一个;<br/>-&nbsp;text:定义一个单行的文本字段;<br/>-&nbsp;email:定义用于e-mail地址的字段;<br/>-&nbsp;date:定义&nbsp;date&nbsp;控件(包括年、月、日,不包括时间);<br/>-&nbsp;time:定义用于输入时间的控件(不带时区);<br/>-&nbsp;number:定义用于输入数字的字段;<br/>-&nbsp;password:定义密码字段(字段中的字符会被遮蔽)。 |
| checked | boolean | false | 否 | 当前组件是否选中,仅type为checkbox和radio生效。 |
| name | string | - | 否 | input组件的名称。<br>type为radio时,name为必填。 |
| name | string | - | 否 | input组件的名称。<br>type为radio时,name为必填。 |
| value | string | - | 否 | input组件的value值,当类型为radio时必填且相同name值的选项该值唯一。 |
| placeholder | string | - | 否 | 设置提示文本的内容,仅在type为text\|email\|date\|time\|number\|password时生效。 |
| maxlength | number | - | 否 | 输入框可输入的最多字符数量,不填表示不限制输入框中字符数量。 |
| enterkeytype | string | default | 否 | 不支持动态修改。<br/>设置软键盘Enter按钮的类型,可选值为:<br/>-&nbsp;default:默认<br/>-&nbsp;next:下一项<br/>-&nbsp;go:前往<br/>-&nbsp;done:完成<br/>-&nbsp;send:发送<br/>-&nbsp;search:搜索<br/>除“next”外,点击后会自动收起软键盘。 |
| headericon | string | - | 否 | 在文本输入前的图标资源路径,该图标不支持点击事件(button,checkbox和radio不生效),图标格式为jpg,png和svg。 |
| showcounter<sup>5+</sup> | boolean | false | 否 | 文本输入框是否显示计数下标,需要配合maxlength一起使用。 |
| menuoptions<sup>5+</sup> | Array&lt;MeunOption&gt; | - | 否 | 设置文本选择弹框点击更多按钮之后显示的菜单项。 |
| menuoptions<sup>5+</sup> | Array&lt;MenuOption&gt; | - | 否 | 设置文本选择弹框点击更多按钮之后显示的菜单项。 |
| autofocus<sup>6+</sup> | boolean | false | 否 | 是否自动获焦。<br/>应用首页中设置不生效,可在onActive中延迟(100-500ms左右)调用focus方法实现输入框在首页中自动获焦。 |
| selectedstart<sup>6+</sup> | number | -1 | 否 | 开始选择文本时初始选择位置。 |
| selectedend<sup>6+</sup> | number | -1 | 否 | 开始选择文本时结尾选择位置。 |
......@@ -64,8 +64,8 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
- 当input类型为text、email、date、time、number、password时,支持如下事件:
| 名称 | 参数 | 描述 |
| 名称 | 参数 | 描述 |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
| change | {<br>&nbsp;value: inputValue<br>&nbsp;} | 输入框输入内容发生变化时触发该事件,返回用户当前输入值。<br/>改变value属性值不会触发该回调。 |
| enterkeyclick | {<br>&nbsp;value: enterKey<br>&nbsp;} | 软键盘enter键点击后触发该事件,返回enter按钮的类型,enterKey类型为number,可选值为:<br/>-&nbsp;2:设置enterkeytype属性为go时生效。<br/>-&nbsp;3:设置enterkeytype属性为search时生效。<br/>-&nbsp;4:设置enterkeytype属性为send时生效。<br/>-&nbsp;5:设置enterkeytype属性为next时生效。<br/>-&nbsp;6:不设置enterkeytype或者设置enterkeytype属性为default、done时生效。 |
......@@ -76,7 +76,7 @@
| selectchange<sup>6+</sup> | {<br>start:&nbsp;number,<br>end:&nbsp;number<br>&nbsp;} | 文本选择变化时触发事件。 |
- 当input类型为checkbox、radio时,支持如下事件:
| 名称 | 参数 | 描述 |
| ------ | ---------------------------------------- | ---------------------------------------- |
| change | {<br>&nbsp;checked:true&nbsp;\|&nbsp;false&nbsp;<br>} | checkbox多选框或radio单选框的checked状态发生变化时触发该事件。 |
......
......@@ -1428,7 +1428,7 @@ transform方法对应一个变换矩阵,想对一个图形进行变化的时
setTransform(scaleX: number, skewX: number, skewY: number, scale: number, translateX: number, translateY: number): void
setTransfrom方法使用的参数和transform()方法相同,但setTransform()方法会重置现有的变换矩阵并创建新的变换矩阵。
setTransform方法使用的参数和transform()方法相同,但setTransform()方法会重置现有的变换矩阵并创建新的变换矩阵。
**参数:**
......
......@@ -3,17 +3,17 @@
> **说明:**
>
> - 从API version 4开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> - 从API version 4开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
>
> - 需要在config.json对应的"abilities"中设置"configChanges"属性为"orientation"
> ```
> "abilities": [
> {
> "configChanges": ["orientation"],
> ...
> }
> ]
> ```
> - 需要在config.json对应的"abilities"中设置"configChanges"属性为"orientation"
> ```
> "abilities": [
> {
> "configChanges": ["orientation"],
> ...
> }
> ]
> ```
视频播放组件。
......@@ -27,26 +27,26 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| muted | boolean | false | 否 | 视频是否静音播放。 |
| src | string | - | 否 | 播放视频内容的路径。 |
| autoplay | boolean | false | 否 | 视频是否自动播放。 |
| controls | boolean | true | 否 | 控制视频播放的控制栏是否显示,如果设置为false,则不显示控制栏。默认为true,由系统决定显示或隐藏控制栏。 |
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | ------- | ----- | ---- | ---------------------------------------- |
| muted | boolean | false | 否 | 视频是否静音播放。 |
| src | string | - | 否 | 播放视频内容的路径。 |
| autoplay | boolean | false | 否 | 视频是否自动播放。 |
| controls | boolean | true | 否 | 控制视频播放的控制栏是否显示,如果设置为false,则不显示控制栏。默认为true,由系统决定显示或隐藏控制栏。 |
## 样式
除支持[通用样式](../arkui-js/js-components-common-styles.md)外,还支持如下样式:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| object-fit | string | contain | 否 | 视频源的缩放类型,如果poster设置了值,那么此配置还会影响视频海报的缩放类型,可选值参考表 object-fit 类型说明。 |
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| ---------- | ------ | ------- | ---- | ---------------------------------------- |
| object-fit | string | contain | 否 | 视频源的缩放类型,如果poster设置了值,那么此配置还会影响视频海报的缩放类型,可选值参考表 object-fit 类型说明。 |
**表1** object-fit 类型说明
| 类型 | 描述 |
| -------- | -------- |
| 类型 | 描述 |
| ---- | ------------------------- |
| fill | 不保持宽高比进行放大缩小,使得图片填充满显示边界。 |
......@@ -54,30 +54,30 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| prepared | {&nbsp;duration:&nbsp;value&nbsp;}<sup>5+</sup> | 视频准备完成时触发该事件,通过duration可以获取视频时长,单位为s。 |
| start | - | 播放时触发该事件。 |
| pause | - | 暂停时触发该事件。 |
| finish | - | 播放结束时触发该事件。 |
| error | - | 播放失败时触发该事件。 |
| seeking | {&nbsp;currenttime:&nbsp;value&nbsp;} | 操作进度条过程时上报时间信息,单位为s。 |
| seeked | {&nbsp;currenttime:&nbsp;value&nbsp;} | 操作进度条完成后,上报播放时间信息,单位为s。 |
| timeupdate | {&nbsp;currenttime:&nbsp;value&nbsp;} | 播放进度变化时触发该事件,单位为s,更新时间间隔为250ms。 |
| 名称 | 参数 | 描述 |
| ---------- | ---------------------------------------- | ------------------------------------- |
| prepared | {&nbsp;duration:&nbsp;value&nbsp;}<sup>5+</sup> | 视频准备完成时触发该事件,通过duration可以获取视频时长,单位为s。 |
| start | - | 播放时触发该事件。 |
| pause | - | 暂停时触发该事件。 |
| finish | - | 播放结束时触发该事件。 |
| error | - | 播放失败时触发该事件。 |
| seeking | {&nbsp;currenttime:&nbsp;value&nbsp;} | 操作进度条过程时上报时间信息,单位为s。 |
| seeked | {&nbsp;currenttime:&nbsp;value&nbsp;} | 操作进度条完成后,上报播放时间信息,单位为s。 |
| timeupdate | {&nbsp;currenttime:&nbsp;value&nbsp;} | 播放进度变化时触发该事件,单位为s,更新时间间隔为250ms。 |
## 方法
除支持[通用方法](../arkui-js/js-components-common-methods.md)外,还支持如下方法:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| start | - | 请求播放视频。 |
| pause | - | 请求暂停播放视频。 |
| 名称 | 参数 | 描述 |
| -------------- | ------------------------------------- | ----------------- |
| start | - | 请求播放视频。 |
| pause | - | 请求暂停播放视频。 |
| setCurrentTime | {&nbsp;currenttime:&nbsp;value&nbsp;} | 指定视频播放的进度位置,单位为s。 |
> **说明:**
> 在attached组件生命周期回调后,可以调用上述组件方法。
> 在attached组件生命周期回调后,可以调用上述组件方法。
## 示例
......@@ -86,7 +86,7 @@
<div class="container">
<video id='videoId' src='/common/myDeram.mp4' muted='false' autoplay='false'
controls='true' onprepared='preparedCallback' onstart='startCallback'
onpaues='pauesCallback' onfinish='finishCallback' onerror='errorCallback'
onpause='pauseCallback' onfinish='finishCallback' onerror='errorCallback'
onseeking='seekingCallback' onseeked='seekedCallback'
ontimeupdate='timeupdateCallback'
style="object-fit:fill; width:80%; height:400px;"
......
......@@ -1831,7 +1831,7 @@ transform方法对应一个变换矩阵,想对一个图形进行变化的时
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
setTransfrom方法使用的参数和transform()方法相同,但setTransform()方法会重置现有的变换矩阵并创建新的变换矩阵。
setTransform方法使用的参数和transform()方法相同,但setTransform()方法会重置现有的变换矩阵并创建新的变换矩阵。
**参数:**
......
......@@ -18,47 +18,47 @@
### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [raw_dir.h](raw__dir_8h.md) | 提供rawfile目录相关功能。 |
| [raw_file.h](raw__file_8h.md) | 提供rawfile文件相关功能。 |
| [raw_file_manager.h](raw__file__manager_8h.md) | 提供资源管理rawfile相关功能。 |
| 文件名称 | 描述 |
| ---------------------------------------- | ------------------ |
| [raw_dir.h](raw__dir_8h.md) | 提供rawfile目录相关功能。 |
| [raw_file.h](raw__file_8h.md) | 提供rawfile文件相关功能。 |
| [raw_file_manager.h](raw__file__manager_8h.md) | 提供资源管理rawfile相关功能。 |
### 结构体
| 结构体名称 | 描述 |
| -------- | -------- |
| [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息。 |
| 结构体名称 | 描述 |
| ---------------------------------------- | ----------------- |
| [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息。 |
### 类型定义
| 类型定义名称 | 描述 |
| -------- | -------- |
| [RawDir](#rawdir) | 提供对rawfile目录的访问。 |
| [RawFile](#rawfile) | 提供对rawfile的访问功能。 |
| [NativeResourceManager](#nativeresourcemanager) | 代表resource manager。 |
| 类型定义名称 | 描述 |
| ---------------------------------------- | ------------------- |
| [RawDir](#rawdir) | 提供对rawfile目录的访问。 |
| [RawFile](#rawfile) | 提供对rawfile的访问功能。 |
| [NativeResourceManager](#nativeresourcemanager) | 代表resource manager。 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_ResourceManager_GetRawFileName](#oh_resourcemanager_getrawfilename) ([RawDir](#rawdir) \*rawDir, int index) | 通过索引获取rawfile文件名称。 |
| [OH_ResourceManager_GetRawFileCount](#oh_resourcemanager_getrawfilecount) ([RawDir](#rawdir) \*rawDir) | 获取[RawDir](#rawdir)中的rawfile数量。 |
| [OH_ResourceManager_CloseRawDir](#oh_resourcemanager_closerawdir) ([RawDir](#rawdir) \*rawDir) | 关闭已打开的[RawDir](#rawdir)并释放所有相关联资源。 |
| [OH_ResourceManager_ReadRawFile](#oh_resourcemanager_readrawfile) (const [RawFile](#rawfile) \*rawFile, void \*buf, size_t length) | 读取rawfile。 |
| [OH_ResourceManager_SeekRawFile](#oh_resourcemanager_seekrawfile) (const [RawFile](#rawfile) \*rawFile, long offset, int whence) | 基于指定的offset,在rawfile文件内搜索读写数据的位置。 |
| [OH_ResourceManager_GetRawFileSize](#oh_resourcemanager_getrawfilesize) ([RawFile](#rawfile) \*rawFile) | 获取rawfile长度,单位为int32_t。 |
| [OH_ResourceManager_CloseRawFile](#oh_resourcemanager_closerawfile) ([RawFile](#rawfile) \*rawFile) | 关闭已打开的[RawFile](#rawfile) 以及释放所有相关联资源。 |
| [OH_ResourceManager_GetRawFileOffset](#oh_resourcemanager_getrawfileoffset) (const [RawFile](#rawfile) \*rawFile) | 获取rawfile当前的offset,单位为int32_t。 |
| [OH_ResourceManager_GetRawFileDescriptor](#oh_resourcemanager_getrawfiledescriptor) (const [RawFile](#rawfile) \*rawFile, [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符。 |
| [OH_ResourceManager_ReleaseRawFileDescriptor](#oh_resourcemanager_releaserawfiledescriptor) (const [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 关闭rawfile文件描述符。 |
| [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager) (napi_env env, napi_value jsResMgr) | 基于JavaScipt resource manager获取native resource manager。 |
| [OH_ResourceManager_ReleaseNativeResourceManager](#oh_resourcemanager_releasenativeresourcemanager) ([NativeResourceManager](#nativeresourcemanager) \*resMgr) | 释放native resource manager。 |
| [OH_ResourceManager_OpenRawDir](#oh_resourcemanager_openrawdir) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*dirName) | 打开rawfile目录。 |
| [OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*fileName) | 打开rawfile文件。 |
| 函数名称 | 描述 |
| ---------------------------------------- | ---------------------------------------- |
| [OH_ResourceManager_GetRawFileName](#oh_resourcemanager_getrawfilename) ([RawDir](#rawdir) \*rawDir, int index) | 通过索引获取rawfile文件名称。 |
| [OH_ResourceManager_GetRawFileCount](#oh_resourcemanager_getrawfilecount) ([RawDir](#rawdir) \*rawDir) | 获取[RawDir](#rawdir)中的rawfile数量。 |
| [OH_ResourceManager_CloseRawDir](#oh_resourcemanager_closerawdir) ([RawDir](#rawdir) \*rawDir) | 关闭已打开的[RawDir](#rawdir)并释放所有相关联资源。 |
| [OH_ResourceManager_ReadRawFile](#oh_resourcemanager_readrawfile) (const [RawFile](#rawfile) \*rawFile, void \*buf, size_t length) | 读取rawfile。 |
| [OH_ResourceManager_SeekRawFile](#oh_resourcemanager_seekrawfile) (const [RawFile](#rawfile) \*rawFile, long offset, int whence) | 基于指定的offset,在rawfile文件内搜索读写数据的位置。 |
| [OH_ResourceManager_GetRawFileSize](#oh_resourcemanager_getrawfilesize) ([RawFile](#rawfile) \*rawFile) | 获取rawfile长度,单位为int32_t。 |
| [OH_ResourceManager_CloseRawFile](#oh_resourcemanager_closerawfile) ([RawFile](#rawfile) \*rawFile) | 关闭已打开的[RawFile](#rawfile) 以及释放所有相关联资源。 |
| [OH_ResourceManager_GetRawFileOffset](#oh_resourcemanager_getrawfileoffset) (const [RawFile](#rawfile) \*rawFile) | 获取rawfile当前的offset,单位为int32_t。 |
| [OH_ResourceManager_GetRawFileDescriptor](#oh_resourcemanager_getrawfiledescriptor) (const [RawFile](#rawfile) \*rawFile, [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符。 |
| [OH_ResourceManager_ReleaseRawFileDescriptor](#oh_resourcemanager_releaserawfiledescriptor) (const [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 关闭rawfile文件描述符。 |
| [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager) (napi_env env, napi_value jsResMgr) | 基于JavaScript resource manager获取native resource manager。 |
| [OH_ResourceManager_ReleaseNativeResourceManager](#oh_resourcemanager_releasenativeresourcemanager) ([NativeResourceManager](#nativeresourcemanager) \*resMgr) | 释放native resource manager。 |
| [OH_ResourceManager_OpenRawDir](#oh_resourcemanager_openrawdir) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*dirName) | 打开rawfile目录。 |
| [OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*fileName) | 打开rawfile文件。 |
## 详细描述
......@@ -69,7 +69,7 @@
### NativeResourceManager
```
typedef struct NativeResourceManager NativeResourceManager
```
......@@ -87,7 +87,7 @@ typedef struct NativeResourceManager NativeResourceManager
### RawDir
```
typedef struct RawDir RawDir
```
......@@ -103,7 +103,7 @@ typedef struct RawDir RawDir
### RawFile
```
typedef struct RawFile RawFile
```
......@@ -122,7 +122,7 @@ typedef struct RawFile RawFile
### OH_ResourceManager_CloseRawDir()
```
void OH_ResourceManager_CloseRawDir (RawDir * rawDir)
```
......@@ -133,9 +133,9 @@ void OH_ResourceManager_CloseRawDir (RawDir * rawDir)
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
| Name | 描述 |
| ------ | ------------------------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
**参见:**
......@@ -148,7 +148,7 @@ void OH_ResourceManager_CloseRawDir (RawDir * rawDir)
### OH_ResourceManager_CloseRawFile()
```
void OH_ResourceManager_CloseRawFile (RawFile * rawFile)
```
......@@ -159,9 +159,9 @@ void OH_ResourceManager_CloseRawFile (RawFile * rawFile)
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| Name | 描述 |
| ------- | --------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**参见:**
......@@ -174,7 +174,7 @@ void OH_ResourceManager_CloseRawFile (RawFile * rawFile)
### OH_ResourceManager_GetRawFileCount()
```
int OH_ResourceManager_GetRawFileCount (RawDir * rawDir)
```
......@@ -187,9 +187,9 @@ int OH_ResourceManager_GetRawFileCount (RawDir * rawDir)
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
| Name | 描述 |
| ------ | ------------------------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
**参见:**
......@@ -202,7 +202,7 @@ int OH_ResourceManager_GetRawFileCount (RawDir * rawDir)
### OH_ResourceManager_GetRawFileDescriptor()
```
bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDescriptor & descriptor )
```
......@@ -215,10 +215,10 @@ bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDe
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| descriptor | 显示rawfile文件描述符,以及在HAP包中的起始位置和长度。 |
| Name | 描述 |
| ---------- | -------------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| descriptor | 显示rawfile文件描述符,以及在HAP包中的起始位置和长度。 |
**返回:**
......@@ -231,7 +231,7 @@ bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDe
### OH_ResourceManager_GetRawFileName()
```
const char* OH_ResourceManager_GetRawFileName (RawDir * rawDir, int index )
```
......@@ -244,10 +244,10 @@ const char* OH_ResourceManager_GetRawFileName (RawDir * rawDir, int index )
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
| index | 表示文件在[RawDir](#rawdir)中的索引位置。 |
| Name | 描述 |
| ------ | ----------------------------- |
| rawDir | 表示指向[RawDir](#rawdir)的指针。 |
| index | 表示文件在[RawDir](#rawdir)中的索引位置。 |
**返回:**
......@@ -264,7 +264,7 @@ const char* OH_ResourceManager_GetRawFileName (RawDir * rawDir, int index )
### OH_ResourceManager_GetRawFileOffset()
```
long OH_ResourceManager_GetRawFileOffset (const RawFile * rawFile)
```
......@@ -277,9 +277,9 @@ rawfile当前的offset。
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| Name | 描述 |
| ------- | --------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**返回:**
......@@ -292,7 +292,7 @@ rawfile当前的offset。
### OH_ResourceManager_GetRawFileSize()
```
long OH_ResourceManager_GetRawFileSize (RawFile * rawFile)
```
......@@ -303,9 +303,9 @@ long OH_ResourceManager_GetRawFileSize (RawFile * rawFile)
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| Name | 描述 |
| ------- | --------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**返回:**
......@@ -318,23 +318,23 @@ Returns rawfile整体长度。
### OH_ResourceManager_InitNativeResourceManager()
```
NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env env, napi_value jsResMgr )
```
**描述:**
基于JavaScipt resource manager获取native resource manager。
基于JavaScript resource manager获取native resource manager。
通过获取resource manager来完成rawfile相关功能。
**参数:**
| Name | 描述 |
| -------- | -------- |
| env | 表示JavaScipt Native Interface (napi)环境指针。 |
| jsResMgr | 表示JavaScipt resource manager。 |
| Name | 描述 |
| -------- | ---------------------------------------- |
| env | 表示JavaScript Native Interface (napi)环境指针。 |
| jsResMgr | 表示JavaScript resource manager。 |
**返回:**
......@@ -347,7 +347,7 @@ NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env en
### OH_ResourceManager_OpenRawDir()
```
RawDir* OH_ResourceManager_OpenRawDir (const NativeResourceManager * mgr, const char * dirName )
```
......@@ -360,10 +360,10 @@ RawDir* OH_ResourceManager_OpenRawDir (const NativeResourceManager * mgr, const
**参数:**
| Name | 描述 |
| -------- | -------- |
| mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| dirName | 表示要打开的rawfile目录名称,当传递一个空字符串时表示打开rawfile根目录。 |
| Name | 描述 |
| ------- | ---------------------------------------- |
| mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| dirName | 表示要打开的rawfile目录名称,当传递一个空字符串时表示打开rawfile根目录。 |
**返回:**
......@@ -382,7 +382,7 @@ RawDir* OH_ResourceManager_OpenRawDir (const NativeResourceManager * mgr, const
### OH_ResourceManager_OpenRawFile()
```
RawFile* OH_ResourceManager_OpenRawFile (const NativeResourceManager * mgr, const char * fileName )
```
......@@ -395,10 +395,10 @@ RawFile* OH_ResourceManager_OpenRawFile (const NativeResourceManager * mgr, cons
**参数:**
| Name | 描述 |
| -------- | -------- |
| mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| fileName | 表示基于rawfile根目录的相对路径下的文件名称。 |
| Name | 描述 |
| -------- | ---------------------------------------- |
| mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| fileName | 表示基于rawfile根目录的相对路径下的文件名称。 |
**返回:**
......@@ -417,7 +417,7 @@ RawFile* OH_ResourceManager_OpenRawFile (const NativeResourceManager * mgr, cons
### OH_ResourceManager_ReadRawFile()
```
int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t length )
```
......@@ -430,11 +430,11 @@ int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| buf | 用于接收读取数据的缓冲区指针。 |
| length | 读取数据的字节长度。 |
| Name | 描述 |
| ------- | --------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| buf | 用于接收读取数据的缓冲区指针。 |
| length | 读取数据的字节长度。 |
**返回:**
......@@ -447,7 +447,7 @@ int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t
### OH_ResourceManager_ReleaseNativeResourceManager()
```
void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * resMgr)
```
......@@ -458,9 +458,9 @@ void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * re
**参数:**
| Name | 描述 |
| -------- | -------- |
| resMgr | 表示[NativeResourceManager](#nativeresourcemanager)指针。 |
| Name | 描述 |
| ------ | ---------------------------------------- |
| resMgr | 表示[NativeResourceManager](#nativeresourcemanager)指针。 |
**自从:**
......@@ -469,7 +469,7 @@ void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * re
### OH_ResourceManager_ReleaseRawFileDescriptor()
```
bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & descriptor)
```
......@@ -482,9 +482,9 @@ bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & desc
**参数:**
| Name | 描述 |
| -------- | -------- |
| descriptor | 包含rawfile文件描述符,以及在HAP包中的起始位置和长度。 |
| Name | 描述 |
| ---------- | -------------------------------- |
| descriptor | 包含rawfile文件描述符,以及在HAP包中的起始位置和长度。 |
**返回:**
......@@ -497,7 +497,7 @@ bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & desc
### OH_ResourceManager_SeekRawFile()
```
int OH_ResourceManager_SeekRawFile (const RawFile * rawFile, long offset, int whence )
```
......@@ -508,11 +508,11 @@ int OH_ResourceManager_SeekRawFile (const RawFile * rawFile, long offset, int wh
**参数:**
| Name | 描述 |
| -------- | -------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| offset | 表示指定的offset。 |
| whence | 读写位置,有以下场景:<br/>**0**: 读写位置为**offset**<br/>**1**: 读写位置为当前位置加上**offset**<br/>**2**: 读写位置为文件末尾(EOF)加上**offset**。 |
| Name | 描述 |
| ------- | ---------------------------------------- |
| rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| offset | 表示指定的offset。 |
| whence | 读写位置,有以下场景:<br/>**0**: 读写位置为**offset**<br/>**1**: 读写位置为当前位置加上**offset**<br/>**2**: 读写位置为文件末尾(EOF)加上**offset**。 |
**返回:**
......
......@@ -82,7 +82,7 @@
### 栅格容器内子组件的栅格设置
栅格容器中的组件使用通用属性useSizeType设置不同的设备宽度类型的占用列数和列偏移。其中span表示栅格容器组件占据columns的数量;offest表示列偏移量,指将组件放置在哪一个columns上。 如:
栅格容器中的组件使用通用属性useSizeType设置不同的设备宽度类型的占用列数和列偏移。其中span表示栅格容器组件占据columns的数量;offset表示列偏移量,指将组件放置在哪一个columns上。 如:
```ts
GridContainer() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册