Android使用ION和PhotoView库
每次我尝试在Android使用ION和PhotoView库,android,imageview,ion,photoviewer,Android,Imageview,Ion,Photoviewer,每次我尝试在PhotoView库的应用程序上使用photoviewatcher时,我的应用程序都会不断崩溃。我正在使用ION显示图像,并尝试获取PhotoView库,以便放大图像。我目前的代码是: public class massiveImageView extends Activity { ImageView mImageView; PhotoViewAttacher mAttacher; Drawable drawable; @Override
PhotoView
库的应用程序上使用photoviewatcher
时,我的应用程序都会不断崩溃。我正在使用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);
}
}
说:
java.lang.NoClassDefFoundError: uk.co.senab.photoview.PhotoViewAttacher
任何帮助都将不胜感激。我仍然不太明白它为什么不起作用,但我找到了答案,没有添加库的依赖关系,我只是在线找到jar文件,并补充说,现在一切都很好。
java.lang.NoClassDefFoundError: uk.co.senab.photoview.PhotoViewAttacher