diff --git a/zh-cn/react-native-image-picker.md b/zh-cn/react-native-image-picker.md index 1bd2f0988851e849d1f0aa20c49b37dd15a980d9..7165eec755cb0f5ddb4a559cd1f5723bb09cff6e 100644 --- a/zh-cn/react-native-image-picker.md +++ b/zh-cn/react-native-image-picker.md @@ -1,5 +1,5 @@ -> 模板版本:v0.1.3 +> 模板版本:v0.2.2

react-native-image-picker

@@ -13,7 +13,7 @@

-> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-image-picker) +> [!Tip] [Github 地址](https://github.com/react-native-oh-library/react-native-image-picker) ## 安装与使用 @@ -82,6 +82,17 @@ export default App; 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +### 在工程根目录的 `oh-package.json` 添加 overrides 字段 + +```json +{ + ... + "overrides": { + "@rnoh/react-native-openharmony" : "./react_native_openharmony" + } +} +``` + ### 引入原生端代码 目前有两种方法: @@ -194,6 +205,8 @@ ohpm install 然后编译、运行即可。 +## 约束与限制 + ## 兼容性 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 @@ -216,14 +229,14 @@ ohpm install | videoQuality | low, medium, or high on iOS, low or high on Android. | string | no | iOS Android | no | | durationLimit | Video max duration (in seconds). | number | no | iOS Android | no | | quality | 0 to 1, photos. | number | no | iOS Android | no | -| cameraType | 'back' or 'front' (May not be supported in few android devices). | string | no | iOS Android | no | -| includeBase64 | If true, creates base64 string of the image (Avoid using on large image files due to performance). | boolean | no | iOS Android Web | no | -| includeExtra | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | boolean | no | iOS Android | no | -| saveToPhotos | (Boolean) Only for launchCamera, saves the image/video file captured to public photo. | boolean | no | iOS Android | no | +| cameraType | 'back' or 'front' (May not be supported in few android devices). | string | no | iOS Android | yes | +| includeBase64 | If true, creates base64 string of the image (Avoid using on large image files due to performance). | boolean | no | iOS Android Web | yes | +| includeExtra | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | boolean | no | iOS Android | yes | +| saveToPhotos | (Boolean) Only for launchCamera, saves the image/video file captured to public photo. | boolean | no | iOS Android | yes | | selectionLimit | Supports providing any integer value. Use 0 to allow any number of files on iOS version >= 14 & Android version >= 13, Use 0 to allow up to 50 files on HarmonyOS. Default is 1. | number | no | iOS Android Web | yes | | presentationStyle | Controls how the picker is presented. currentContext, pageSheet, fullScreen, formSheet, popover, overFullScreen, overCurrentContext. Default is currentContext. | string | no | iOS | no | | formatAsMp4 | Converts the selected video to MP4 (iOS Only). | boolean | no | iOS | no | -| assetRepresentationMode | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. | boolean | no | iOS | no | +| assetRepresentationMode | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. | string | no | iOS | no | ### The Response Object @@ -255,13 +268,9 @@ ohpm install | Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------------ | -------------------------------------- | -------- | -------- | --------------- | ----------------- | -| launchCamera | Launch camera to take photo or video. | function | yes | iOS Android Web | no | +| launchCamera | Launch camera to take photo or video. | function | yes | iOS Android Web | yes | | launchImageLibrary | Launch gallery to pick image or video. | function | yes | iOS Android Web | yes | -## 遗留问题 - -- 只实现了选择图库的接口属性,相机功能暂未适配 - ## 其他 ## 开源协议