小编Jan*_*ros的帖子

ImageViewZoom中不显示图像

我想在ImagePagerActivity中使用ImageViewZoomUniversal Image Loader.

那么,我做了什么:

  1. 我将imageviewtouch.jar添加到项目类路径中.
  2. 在ImagePagerActivity中,我在instantiateItem()函数中更改了一行.我评论了ImageView的位置,并将其替换为ImageViewTouch(4.和5.行)

    @Override
    public Object instantiateItem(View view, int position) {
        final View imageLayout = inflater.inflate(R.layout.item_pager_image, null);
        //final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image);
        final ImageViewTouch imageView = (ImageViewTouch) imageLayout.findViewById(R.id.image);
    
        final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading);
        final TextView textView = (TextView)imageLayout.findViewById(R.id.text);
    
        imageLoader.displayImage(images[position], imageView, options, new ImageLoadingListener() {
    
    
            public void onLoadingStarted() {
                spinner.setVisibility(View.VISIBLE);
            }
    
    
            public void onLoadingFailed(FailReason failReason) {
                String message = null;
                switch (failReason) {
                    case IO_ERROR:
                        message = "Input/Output error";
                        break;
                    case OUT_OF_MEMORY: …
    Run Code Online (Sandbox Code Playgroud)

android android-viewpager universal-image-loader

5
推荐指数
1
解决办法
1903
查看次数