引入依赖:
implementation 'com.wdeo3601:pdf-view:1.0.4'
xml文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<com.wdeo3601.pdfview.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
</RelativeLayout >
封装代码:
private void showPdfInDialog(String fileName) {
Dialog dialog = ne