1
我的應用程序總是崩潰每次我試圖在我的PhotoView
庫的應用程序中使用PhotoViewAttacher
時間。我使用ION
顯示圖像,並試圖讓PhotoView
庫,讓我放大到他們。我的代碼目前是:的Android使用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
任何幫助將非常感激。