小编Jot*_*rdo的帖子

Xamarin Android:如何从资产文件夹共享PDF文件?通过WhatsApp我得到的消息是你选择的文件不是文件

我使用Xamarin Android.我有一个PDF文件存储在Xamarin Android的Assets文件夹中.

在此输入图像描述

我想在WhatsApp中分享这个文件,但收到的消息是:

您选择的文件不是文档.

在此输入图像描述

我试过两种方法:

这是第一种方式

var SendButton = FindViewById<Button>(Resource.Id.SendButton);
SendButton.Click += (s, e) =>

                {
                ////Create a new file in the exteranl storage and copy the file from assets folder to external storage folder
                Java.IO.File dstFile = new Java.IO.File(Environment.ExternalStorageDirectory.Path + "/my-pdf-File--2017.pdf");
                dstFile.CreateNewFile();

                var inputStream = new FileInputStream(Assets.OpenFd("my-pdf-File--2017.pdf").FileDescriptor);
                var outputStream = new FileOutputStream(dstFile);
                CopyFile(inputStream, outputStream);

                //to let system scan the audio file and detect it
                Intent intent = new Intent(Intent.ActionMediaScannerScanFile);
                intent.SetData(Uri.FromFile(dstFile));
                this.SendBroadcast(intent);

                //share the Uri of the …
Run Code Online (Sandbox Code Playgroud)

pdf share android-intent xamarin.android whatsapp

7
推荐指数
1
解决办法
1599
查看次数

更漂亮的括号SameLine 设置为 true 不适用于自闭合元素 Vuejs

我使用的是 prettier 扩展版本 2.7.1。

我设置了一些配置,包括把bracketSameLine设置为true。在setting.json文件中。

{
    "prettier.bracketSameLine": true
}
Run Code Online (Sandbox Code Playgroud)

我还添加了其他配置:

更漂亮的配置

描述说“括号同一行”如果true,放置 > 多行,我在工作区用户设置中将其设置为 true 。

支架同线

然而,当我用 prettier 格式化我的 Vue 文件时,结果似乎没有按我的预期工作。因为描述还说“不适用于自关闭元素”。缺少什么配置来应用于自关闭元素?

输入:

<small id="helper id" class="form-text text-muted">A longish piece of text here</small>

<p
  *ngIf="this.parent.descriptors && this.parent.descriptors.length"
  class="post-meta">
  <span
     class="post-meta__item"
    *ngFor="let descriptor of this.parent.descriptors"
    >Another piece of text here</span>
</p>
Run Code Online (Sandbox Code Playgroud)

输出:

<small id="helper id" class="form-text text-muted">A longish piece of text here</small>

<p *ngIf="this.parent.descriptors && this.parent.descriptors.length" class="post-meta">
  <span class="post-meta__item" *ngFor="let descriptor of this.parent.descriptors"
    >Another piece …
Run Code Online (Sandbox Code Playgroud)

vue.js visual-studio-code prettier

6
推荐指数
1
解决办法
2353
查看次数

Xamarin Android:如何创建撤消栏

我想知道如何为Xamarin Android创建一个像这样的撤销栏.

在此输入图像描述

我用这个代码由丹Ardelean为Xamarin的Android谁从基本的代码创建罗马Nurik例如针对Android,但它并没有为我工作.我收到这条消息:

无法从本机句柄0x200019(key_handle 0xf9f4bcb)激活SwipeDismissListView.MainActivity类型的实例.--->

System.MissingMethodException: No constructor found for SwipeDismissListView.MainActivity::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. --- End of inner exception stack trace --- at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in <d855bac285f44dda8a0d8510b679b1e2>:0 at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <d855bac285f44dda8a0d8510b679b1e2>:0 --- End of inner exception stack trace --- at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x0017d] in <d855bac285f44dda8a0d8510b679b1e2>:0 at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type …

listview undo swipe dismiss xamarin.android

5
推荐指数
0
解决办法
230
查看次数