Android之SubsamplingScaleImageView加载长图不能放缩问题
1 问题
第三方开源框架用了这个第三方开源框架(SubsamplingScaleImageView)加载长图,但是源代码在有些手机上面不能进行放缩。
private void displayLongPic(Uri uri, SubsamplingScaleImageView longImg) {
longImg.setQuickScaleEnabled(true);
longImg.setZoomEnabled(true);
longImg.setPanEnabled(true);
longImg.setDoubleTapZoomDuration(100);
longImg.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
longImg.setDoubleTapZoomDpi(SubsamplingScaleImageView.ZOOM_FOCUS_CENTER);
longImg.setImage(ImageSource.uri(uri), new ImageViewState(0, new PointF(0, 0), 0));
}
2 解决办法
把部分设置全部去掉,坑死我了,直接一行代码就行。
private void displayLongPic(Uri uri, SubsamplingScaleImageView longImg) {
longImg.setImage(ImageSource.uri(uri), new ImageViewState(0, new PointF(0, 0), 0));
}
赞 (0)