2015-02-08 10 views
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 

任何幫助將非常感激。

回答

1

我還是不太明白爲什麼它不工作,但我可以找到答案,在這裏,而不是把庫的依賴關係,我只是發現了jar文件的在線和補充,而不是現在一切工作都很完美。 Library Link