Android 开发问题:为 PDFView 设置一个带有黑色边框的背景 drawable,但边框没有生效 ?xml version1.0 encodingutf-8?shapexmlns:androidhttp://schemas.android.com/apk/res/androidandroid:shaperectanglestrokeandroid:width1dpandroid:colorcolor/black//shapecom.github.barteksc.pdfviewer.PDFViewandroid:idid/pdfv_containerandroid:layout_widthmatch_parentandroid:layout_height250dpandroid:layout_marginTop20dpandroid:backgrounddrawable/item_dialog_notice_pdfv_container/在 Android 开发中执行上述代码为 PDFView 设置一个带有黑色边框的背景 drawable但边框没有生效问题原因PDFView 在绘制 PDF 页面时会覆盖掉背景 drawable 的绘制处理策略用一个外层容器包裹 PDFView把边框加在外层容器上同时给外层容器设置内边距FrameLayoutandroid:layout_widthmatch_parentandroid:layout_height250dpandroid:layout_marginTop20dpandroid:backgrounddrawable/item_dialog_notice_pdfv_containerandroid:padding1dpcom.github.barteksc.pdfviewer.PDFViewandroid:idid/pdfv_containerandroid:layout_widthmatch_parentandroid:layout_heightmatch_parent//FrameLayout也尝试过给 PDFView 设置内边距让 PDF 内容不贴边但是这种方法无效com.github.barteksc.pdfviewer.PDFViewandroid:idid/pdfv_containerandroid:layout_widthmatch_parentandroid:layout_height250dpandroid:layout_marginTop20dpandroid:backgrounddrawable/item_dialog_notice_pdfv_containerandroid:padding1dp/