【发布时间】:2018-05-01 15:08:17
【问题描述】:
import { takePicture, CameraOptions } from "nativescript-camera";
CameraOptions 允许将saveToGallery 设置为false。
但是,当我使用takePicture 创建ImageAsset 时,图像会存储在我的Android 设备的内部存储> Android > 数据> org.nativescript.appname > 文件中。资产(asset.android) 的控制台输出为:
/storage/emulated/0/Android/data/org.nativescript.HelloWorld/files/NSIMG_20180430_131826.jpg
我使用imageSource.ImageSource().fromAsset 和imageSource.ImageSource.saveToFile 将图像保存在某个已知位置,现在我想从我的设备中删除源文件NSIMG_20180430_131826.jpg。
有人可以帮忙吗?
【问题讨论】:
-
存在一个已知错误,在某些手机上无法设置
saveToGallery,因此默认为true,github问题为here -
@mast3rd3mon 该文件没有出现在“图库”中(以及使用设备拍摄的其他照片),但它保存在应用程序本地的文件夹中。问题是我无法以编程方式“看到”这个本地文件夹,也无法使用绝对路径删除文件。
标签: angular nativescript