Zoom ImageView in android like Instagram

前端 未结 3 1515
臣服心动
臣服心动 2021-02-03 11:25

How can I zoom ImageView like Instagram. I mean changing the size of imageview, not zooming the image inside the Imageview.

For zooming the image inside the Imageview, t

相关标签:
3条回答
  • 2021-02-03 11:56

    I recommend Zoomy, very simple and functional.

    Just add the following to your current ImageView:

    Zoomy.Builder builder = new Zoomy.Builder(this).target(mZoomableView);
    builder.register();
    
    0 讨论(0)
  • 2021-02-03 12:17

    thanks

    I have added this to my gradle.build

     compile 'it.sephiroth.android.library.imagezoom:imagezoom:2.2.5'
    

    and then using this view

      <it.sephiroth.android.library.imagezoom.ImageViewTouch
        android:id="@+id/mp3Image"
        android:adjustViewBounds="true"
        android:layout_width="346dp"
        android:layout_height="356dp"
        android:scaleType="fitCenter" />
    

    and the below code, the zoom came to my app

       myImage = (ImageViewTouch) findViewById(R.id.mp3Image);
        myImage.setDisplayType(ImageViewTouchBase.DisplayType.FIT_IF_BIGGER);
    
    0 讨论(0)
  • 2021-02-03 12:20

    I would recommend these two libraries:

    1. PhotoView

    2. ImageViewZoom

    For PhotoView, you just have to create an attacher and "attach" it to your ImageView.

    Some code

    // After getting your imageImage view, attach it like the following
    PhotoViewAttacher yourAttacher = new PhotoViewAttacher(yourImageView);
    

    With just this code, you'll be able to zoom in/out/whatever on yourImageView. Check the links above for more details.

    0 讨论(0)
提交回复
热议问题