【问题标题】:how open a pdf file from assents in an xamarin Android forms如何在 xamarin Android 表单中从同意中打开 pdf 文件
【发布时间】:2018-11-21 05:08:20
【问题描述】:

我想在 Xamarin Android 中打开 assents 文件夹到 activity 的 PDF 文件

【问题讨论】:

标签: xamarin xamarin.forms xamarin.android xamarin-studio


【解决方案1】:

MainActivity.cs

使用 Com.Joanzapata.Pdfview; 使用 Com.Joanzapata.Pdfview.Listener;

命名空间打开pdf { [活动(标签=“openpdf”,MainLauncher = true)] 公共类 MainActivity : 活动 {

    PDFView pdf;
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.Main);

        **pdf = FindViewById<PDFView>(Resource.Id.pDFView1);
        pdf.FromAsset("finished.pdf").Load();**
    }
}

}

Main.Axml

<com.joanzapata.pdfview.PDFView
    android:layout_width="match_parent"
    android:layout_height="548.5dp"
    android:id="@+id/pDFView1" />

【讨论】:

    猜你喜欢
    • 2021-09-28
    • 2020-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-12
    • 2016-12-22
    • 1970-01-01
    • 2019-08-26
    相关资源
    最近更新 更多