【问题标题】:Android using ION with PhotoView LibraryAndroid 使用 ION 和 PhotoView 库
【发布时间】:2015-04-08 04:26:38
【问题描述】:

每次我尝试在PhotoView 库的应用程序上使用PhotoViewAttacher 时,我的应用程序都会崩溃。我正在使用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

任何帮助将不胜感激。

【问题讨论】:

    标签: android imageview ion photoviewer


    【解决方案1】:

    我仍然不太明白为什么它不起作用,但我能够找到答案,而不是添加库的依赖项,我只是在网上找到了 jar 文件并添加了它,现在一切工作完美。 Library Link

    【讨论】:

      猜你喜欢
      • 2014-02-02
      • 2016-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-18
      • 2018-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多