使用PCLStorage进行Xamarin.Forms时遇到问题。我尝试创建新文件夹以将我的画布保存为图像,它甚至不想创建新文件夹。我不知道出了什么问题,因为我已经检查过许多指南Xamarin上的存储文件,我没有找到任何解决方案。到目前为止我的代码是:
saveButt.Clicked += async (sender, args) =>
{
String folderName ="testFolder" ;
IFolder folder = FileSystem.Current.LocalStorage;
folder = await folder.CreateFolderAsync(folderName, CreationCollisionOption.ReplaceExisting);
ExistenceCheckResult folderexist = await folder.CheckExistsAsync(folderName);
if (folderexist == ExistenceCheckResult.FolderExists)
{
await DisplayAlert("Alert", "Exists", "OK");
}
};