提供从库里选择图片,或者拍照的系统 UI。
Exponent.ImagePicker.
launchImageLibraryAsync
(options)¶显示从库里选择图片的系统 UI。
参数 map:
false
.allowsEditing: true
),
一个 [x, y]
数组, 定义需要维持的宽高比。只有 Android 支持,因为 iOS 上裁切永远是一个正方形。如果用户取消选择图片的话,返回 { cancelled: true }
.
否则的话, 返回 { cancelled: false, uri, width, height }
, uri
代表本地图片的
URI (可以在 React Native Image
组件里使用), width, height
是图片的纬度。
Exponent.ImagePicker.
launchCameraAsync
(options)¶Display the system UI for taking a photo with the camera.
参数map:
false
.allowsEditing: true
),
一个 [x, y]
数组, 定义需要维持的宽高比。只有 Android 支持,因为 iOS 上裁切永远是一个正方形。如果用户取消拍照的话,返回 { cancelled: true }
.
否则的话, 返回 { cancelled: false, uri, width, height }
, uri
代表本地图片的
URI (可以在 React Native Image
组件里使用), width, height
是图片的纬度。