Open WangManAndroid opened 7 years ago
You can configure PDFView
like any other Android view
but if the PDFView is the child of ScrollView it will show nothing, how could i solved it ,I am in a hurry
maybe it is too late. but using getViewTreeObserver().addOnGlobalLayoutListener on pdf view can solve the problem. following is a code snipe. hop it can help:
pdfView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { pdfView.getViewTreeObserver().removeOnGlobalLayoutListener(this); ViewGroup.LayoutParams params = pdfView.getLayoutParams(); params.width = ViewUtil.getWindowWidth(getContext()); params.height = [Height you want]; pdfView.setLayoutParams(params); } } });
how could i change the PDFView height?like the ScrollView ,but now the PDFView height is settled