体验极佳的Android图片手势控件。An Android image gesture control with excellent user experience.
English | 简体中文
A gesture-friendly and easy-to-use image pinch-zoom control. It extends ImageView, is contained in a single class file, has no external dependencies, and is lightweight and easy to integrate.
1) Copy PinchImageView.java into your project.
2) Add the following code to your layout file; it can already display an image from resources:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.boycy815.pinchimageview.PinchImageView
android:id="@+id/pic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/my_pic"/>
</RelativeLayout>3) Use it directly as an ImageView:
// Retrieve it as an ImageView
ImageView imageView = (ImageView) findViewById(R.id.pic);
// You can set the image using any method supported by ImageView
imageView.setImageResource(R.drawable.my_pic);
// or...
imageView.setImageBitmap(bitmap);
// or...
imageView.setImageDrawable(drawable);
// or you can even use third-party image loading libraries, like ImageLoader
imageLoader.displayImage("http://host.com/my_pic.jpg", imageView);No open issues yet, or sync has not completed.