npm i --save 原生Telegram图片选择器
- 版本:1.0.3
- GitHub: https://github.com/bradmartin/nativescript-telegram-image-picker
- NPM: https://npmjs.net.cn/package/nativescript-telegram-image-picker
- 下载
- 昨日: 0
- 上周: 4
- 上个月: 29
NativeScript-Telegram-Image-Picker
使用TelegramGallery图片选择器库的NativeScript插件,为Android提供自定义图片选择器。
** 仅限Android ** - 此插件使用原生Android库,因此iOS没有直接等效的版本。
许可证
此插件由Brad Martin许可,采用MIT许可证。
安装
tns plugin add nativescript-telegram-image-picker
TypeScript
import { openTelegramImagePicker, TelegramPickerResponse } from 'nativescript-telegram-image-picker';
public whateverYouLike() {
// Open the Telegram Gallery Image Picker Activity
openTelegramImagePicker(5).then((resp: TelegramPickerResponse) => {
// looping over the selected pictures in the response
for (var i = 0; i < resp.photos.length; i++) {
console.log(resp.photos[i]);
}
})
}
API
- openTelegramImagePicker(photoLimit?: number): Promise TelegramPickerResponse;
TelegramPickerResponse - { photos: Array