Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想问一下如何知道用户何时在android的PDFView中滑动到下一页。
pdfView = findViewById(R.id.pdfView);
pdfView.fromAsset("aday.pdf") .defaultPage(0) .enableSwipe(true) .load(); pdfView.setSwipeVertical(false);
当我使用 getPageCount(); 它总是返回 0。那么解决方案是什么?
为了在用户到达某个页面时收到通知 - 尝试注册一个监听器:
pdfView.fromAsset("aday.pdf") .defaultPage(0) .enableSwipe(true) .onPageChange(new OnPageChangeListener() { @Override public void onPageChanged(int page, int pageCount) { //page: the new page displayed, starting from 0 } }).load();