如何从 xamarin Android 表单中的同意打开 pdf 文件
how open a pdf file from assents in an xamarin Android forms
我想在 Xamarin assents 文件夹中打开一个 PDF 文件到 activity Android
在MainActivity.cs
使用Com.Joanzapata.Pdfview;
使用 Com.Joanzapata.Pdfview.Listener;
命名空间打开pdf
{
[Activity(标签 = "openpdf", MainLauncher = true)]
public class 主要Activity : Activity
{
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" />
我想在 Xamarin assents 文件夹中打开一个 PDF 文件到 activity Android
在MainActivity.cs
使用Com.Joanzapata.Pdfview; 使用 Com.Joanzapata.Pdfview.Listener;
命名空间打开pdf { [Activity(标签 = "openpdf", MainLauncher = true)] public class 主要Activity : Activity {
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" />