我需要在ImageView中显示图片,并且我想要的功能仅仅是对ImageView进行捏合和缩放。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gesture-image="http://schemas.polites.com/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.polites.android.GestureImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/image"
gesture-image:min-scale="0.1"
gesture-image:max-scale="10.0"
gesture-image:strict="false"/>
这个类处理双指缩放和双击手势。
http://www.codeproject.com/Articles/319401/Simple-Gestures-on-Android
尝试使用这个库,它非常惊人,可以提供平滑的缩放、旋转功能,并且非常易于使用。
一行代码
。 - Basheer AL-MOMANI