Change the size of ImageView on zooming

后端 未结 8 2298
逝去的感伤
逝去的感伤 2021-02-14 01:15

I am using chrisbanes PhotoView to implement pinch zoom..Image zooms on pinching and double tapping but i can\'t see that my image streched to full screen on zooming..on zooming

8条回答
  •  鱼传尺愫
    2021-02-14 01:38

    The problem is that when using NetworkImageView does not behave the same as an ImageView, I solve it by creating an xml design for portrait and landscape

    PORTRAIT

    layout/item_image.xml

    height="match_parent" and width="wrap_content", important scaleType="fitCenter"

     
    

    LAND

    layout/land/item_image.xml

    now in the land layout the height="wrap_content" and width="match_parent", always scaleType="fitCenter"

     
    

    It's also important to instantiate the PhotoViewAttacher object after assigning the resource to the NetworkImageView control

        NetworkImageView imageView;
        PhotoViewAttacher mAttacher;
    
            imageView = (NetworkImageView) 
            mImgPagerView.findViewById(R.id.imageitem);
            //firts set the image resources, i'm using Android Volley Request
            ImageLoader imageLoader = MySocialMediaSingleton.getInstance(context).getImageLoader();
            imageView.setImageUrl(url, imageLoader);
            //next create instance of PhotoViewAttecher
            mAttacher = new PhotoViewAttacher(imageView);
            mAttacher.update();
    

提交回复
热议问题