提交 a42f9d80 编写于 作者: H HelloCrease

update doc

Signed-off-by: NHelloCrease <lian15@huawei.com>
上级 a819e6c6
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
- Other - Other
- [Ability Assistant Usage](ability/ability-assistant-guidelines.md) - [Ability Assistant Usage](ability/ability-assistant-guidelines.md)
- [UI](ui/Readme-EN.md) - [UI](ui/Readme-EN.md)
- [ArkUI Overview](arkui-overview.md)
- JavaScript-based Web-Like Development Paradigm - JavaScript-based Web-Like Development Paradigm
- [Overview](ui/ui-js-overview.md) - [Overview](ui/ui-js-overview.md)
- Framework - Framework
...@@ -58,6 +59,7 @@ ...@@ -58,6 +59,7 @@
- [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md) - [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md)
- [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md) - [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md)
- [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md) - [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md)
- [Defining Animations for SVG Components](ui/ui-js-animate-svg.md)
- JS Animation - JS Animation
- [Component Animation](ui/ui-js-animate-component.md) - [Component Animation](ui/ui-js-animate-component.md)
- Interpolator Animation - Interpolator Animation
...@@ -72,6 +74,8 @@ ...@@ -72,6 +74,8 @@
- [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md) - [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md)
- ["js" Tag](ui/ts-framework-js-tag.md) - ["js" Tag](ui/ts-framework-js-tag.md)
- Resource Access - Resource Access
- [Accessing Application Resources](ui/ts-application-resource-access.md)
- [Accessing System Resources](ui/ts-system-resource-access.md)
- [Media Resource Types](ui/ts-media-resource-type.md) - [Media Resource Types](ui/ts-media-resource-type.md)
- [Pixel Units](ui/ts-pixel-units.md) - [Pixel Units](ui/ts-pixel-units.md)
- [Types](ui/ts-types.md) - [Types](ui/ts-types.md)
...@@ -189,6 +193,12 @@ ...@@ -189,6 +193,12 @@
- Sensor - Sensor
- [Sensor Overview](device/sensor-overview.md) - [Sensor Overview](device/sensor-overview.md)
- [Sensor Development](device/sensor-guidelines.md) - [Sensor Development](device/sensor-guidelines.md)
- Sensor
- [Sensor Overview](device/sensor-overview.md)
- [Sensor Development](device/sensor-guidelines.md)
- Vibrator
- [vibrator-Overview.md](device/vibrator-overview.md)
- [Vibrator Development](device/vibrator-guidelines.md)
- Device Usage Statistics - Device Usage Statistics
- [Device Usage Statistics Overview](device-usage-statistics/device-usage-statistics-overview.md) - [Device Usage Statistics Overview](device-usage-statistics/device-usage-statistics-overview.md)
- [Device Usage Statistics Development](device-usage-statistics/device-usage-statistics-dev-guide.md) - [Device Usage Statistics Development](device-usage-statistics/device-usage-statistics-dev-guide.md)
...@@ -318,7 +328,7 @@ ...@@ -318,7 +328,7 @@
- [Key Event](reference/arkui-ts/ts-universal-events-key.md) - [Key Event](reference/arkui-ts/ts-universal-events-key.md)
- [Focus Event](reference/arkui-ts/ts-universal-focus-event.md) - [Focus Event](reference/arkui-ts/ts-universal-focus-event.md)
- [Mouse Event](reference/arkui-ts/ts-universal-mouse-key.md) - [Mouse Event](reference/arkui-ts/ts-universal-mouse-key.md)
- [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md) - [Component Area Change Event](reference/arkui-ts/ts-universal-component-area-change-event.md)
- Universal Attributes - Universal Attributes
- [Size](reference/arkui-ts/ts-universal-attributes-size.md) - [Size](reference/arkui-ts/ts-universal-attributes-size.md)
- [Location](reference/arkui-ts/ts-universal-attributes-location.md) - [Location](reference/arkui-ts/ts-universal-attributes-location.md)
...@@ -404,13 +414,13 @@ ...@@ -404,13 +414,13 @@
- [List](reference/arkui-ts/ts-container-list.md) - [List](reference/arkui-ts/ts-container-list.md)
- [ListItem](reference/arkui-ts/ts-container-listitem.md) - [ListItem](reference/arkui-ts/ts-container-listitem.md)
- [Navigator](reference/arkui-ts/ts-container-navigator.md) - [Navigator](reference/arkui-ts/ts-container-navigator.md)
- [Navigation](reference/arkui-ts/ts-container-navigation.md) - [Navigation](reference/arkui-ts/ts-basic-components-navigation.md)
- [Panel](reference/arkui-ts/ts-container-panel.md) - [Panel](reference/arkui-ts/ts-container-panel.md)
- [Refresh](reference/arkui-ts/ts-container-refresh.md) - [Refresh](reference/arkui-ts/ts-container-refresh.md)
- [Row](reference/arkui-ts/ts-container-row.md) - [Row](reference/arkui-ts/ts-container-row.md)
- [RowSplit](reference/arkui-ts/ts-container-rowsplit.md) - [RowSplit](reference/arkui-ts/ts-container-rowsplit.md)
- [Scroll](reference/arkui-ts/ts-container-scroll.md) - [Scroll](reference/arkui-ts/ts-container-scroll.md)
- [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md) - [ScrollBar](reference/arkui-ts/ts-basic-components-scrollbar.md)
- [SideBarContainer](reference/arkui-ts/ts-container-sidebarcontainer.md) - [SideBarContainer](reference/arkui-ts/ts-container-sidebarcontainer.md)
- [Stack](reference/arkui-ts/ts-container-stack.md) - [Stack](reference/arkui-ts/ts-container-stack.md)
- [Swiper](reference/arkui-ts/ts-container-swiper.md) - [Swiper](reference/arkui-ts/ts-container-swiper.md)
...@@ -530,12 +540,12 @@ ...@@ -530,12 +540,12 @@
- [USB](reference/apis/js-apis-usb.md) - [USB](reference/apis/js-apis-usb.md)
- [Location](reference/apis/js-apis-geolocation.md) - [Location](reference/apis/js-apis-geolocation.md)
- Basic Features - Basic Features
- [Application Context](reference/apis/js-apis-basic-features-app-context.md) - [Application Context](reference/apis/js-apis-system-app.md)
- [Console Logs](reference/apis/js-apis-basic-features-logs.md) - [Console Logs](reference/apis/js-apis-logs.md)
- [Page Routing](reference/apis/js-apis-basic-features-routes.md) - [Page Routing](reference/apis/js-apis-system-router.md)
- [Timer](reference/apis/js-apis-basic-features-timer.md) - [Timer](reference/apis/js-apis-timer.md)
- [Setting the System Time](reference/apis/js-apis-system-time.md) - [Setting the System Time](reference/apis/js-apis-system-time.md)
- [Animation](reference/apis/js-apis-basic-features-animator.md) - [Animation](reference/apis/js-apis-animator.md)
- [WebGL](reference/apis/js-apis-webgl.md) - [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md) - [WebGL2](reference/apis/js-apis-webgl2.md)
- [Screenshot](reference/apis/js-apis-screenshot.md) - [Screenshot](reference/apis/js-apis-screenshot.md)
......
...@@ -7,3 +7,9 @@ ...@@ -7,3 +7,9 @@
- [Location Overview](device-location-overview.md) - [Location Overview](device-location-overview.md)
- [Obtaining Device Location Information](device-location-info.md) - [Obtaining Device Location Information](device-location-info.md)
- [Geocoding and Reverse Geocoding Capabilities](device-location-geocoding.md) - [Geocoding and Reverse Geocoding Capabilities](device-location-geocoding.md)
- Sensor
- [Sensor Overview](sensor-overview.md)
- [Sensor Development](sensor-guidelines.md)
- Vibrator
- [vibrator-Overview.md](vibrator-overview.md)
- [Vibrator Development](vibrator-guidelines.md)
\ No newline at end of file
# Image Cache
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This method is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```
import app from '@system.app'
```
## Required Permissions
None
## app.setImageCacheCount
setImageCacheCount(value: number): void
Sets the maximum number of decoded images that can be cached in the memory to speed up the loading of images from the same sources. If the input parameter is not set, the default value **0** is used, indicating that images are not cached. The built-in Least Recently Used (LRU) policy is used for caching. After new images are loaded, if the upper limit of the cache is exceeded, the images that have not been updated for the longest time will be replaced. You are advised to set the input parameter based on the application memory requirements. If the number of images is too large, the memory usage may be too high.
- Parameters
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| value | number | Yes | Number of decoded images that are cached in the memory. |
- Example
```
// app.ets
import app from '@system.app';
export default {
onCreate() {
app.setImageCacheCount(100) // Set the maximum number of decoded images that can be cached in the memory to 100.
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
```
## app.setImageRawDataCacheSize
setImageRawDataCacheSize(value: number): void
Sets the maximum size (in bytes) of the image data cached in the memory before decoding to speed up the loading of images from the same sources. If the input parameter is not set, the default value **0** is used, indicating that images are not cached. The LRU policy is used for caching. After new images are loaded, if the upper limit of the cache is exceeded, the images that have not been updated for the longest time will be replaced. You are advised to set the input parameter based on the application memory requirements. If the image cache is too large, the memory usage may be too high.
- Parameters
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| value | number | Yes | Size of the image data cached before decoding, in bytes. |
- Example
```
// app.ets
import app from '@system.app';
export default {
onCreate() {
app.setImageRawDataCacheSize(104,857,600) // Set the upper limit of the memory for caching image data before decoding to 100 MB.
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
```
## app.setImageFileCacheSize
setImageFileCacheSize(value: number): void
Sets the maximum size of the image file cache (in bytes) to speed up the loading of images from the same sources, especially online image sources and thumbnails. If the input parameter is not set, the default value 100 MB is used. The LRU policy is used for caching. After new images are loaded, if the upper limit of the cache is exceeded, the images that have not been updated for the longest time will be replaced. You are advised to set the input parameter based on the application memory requirements. If the image cache is too large, the disk usage may be too high.
- Parameters
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| value | number | Yes | Size of the image file cache, in bytes. |
- Example
```
// app.ets
import app from '@system.app';
export default {
onCreate() {
app.setImageFileCacheSize(209,715,200) // Set the upper limit of the image file cache to 200 MB.
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
```
此差异已折叠。
...@@ -590,6 +590,10 @@ ...@@ -590,6 +590,10 @@
- [升级](reference/apis/js-apis-update.md) - [升级](reference/apis/js-apis-update.md)
- [USB管理](reference/apis/js-apis-usb.md) - [USB管理](reference/apis/js-apis-usb.md)
- [位置服务](reference/apis/js-apis-geolocation.md) - [位置服务](reference/apis/js-apis-geolocation.md)
- [输入设备](reference/apis/js-apis-inputdevice.md)
- [组合按键](reference/apis/js-apis-inputconsumer.md)
- [输入监听](reference/apis/js-apis-inputmonitor.md)
- [事件注入](reference/apis/js-apis-inputeventclient.md)
- 基本功能 - 基本功能
- [应用上下文](reference/apis/js-apis-system-app.md) - [应用上下文](reference/apis/js-apis-system-app.md)
- [日志打印](reference/apis/js-apis-logs.md) - [日志打印](reference/apis/js-apis-logs.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册