每次我尝试PhotoViewAttacher
在我的PhotoView
库应用程序上使用时,我的应用程序都会崩溃。我ION
用来显示图像并试图让PhotoView
图书馆允许我放大它们。我目前的代码是:
public class massiveImageView extends Activity {
ImageView mImageView;
PhotoViewAttacher mAttacher;
Drawable drawable;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.massive_image_view);
// Any implementation of ImageView can be used!
mImageView = (ImageView) findViewById(R.id.imageViewMassivePage);
Ion.with(this).load("https://pbs.twimg.com/profile_images/522909800191901697/FHCGSQg0.png").withBitmap().asBitmap()
.setCallback(new FutureCallback<Bitmap>() {
@Override
public void onCompleted(Exception e, Bitmap result) {
// do something with your bitmap
drawable=new BitmapDrawable(result);
mImageView.setImageDrawable(drawable);
}
});
mAttacher = new PhotoViewAttacher(mImageView);
}
}
我得到的错误是在这一行:
mAttacher = new PhotoViewAttacher(mImageView);
说:
java.lang.NoClassDefFoundError: uk.co.senab.photoview.PhotoViewAttacher
任何帮助将不胜感激。