如何捏在图像缩放的Andr​​oid变焦图像? [英] How pinch zoom image in image zoom android?

查看:149
本文介绍了如何捏在图像缩放的Andr​​oid变焦图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在ImageView的显示图像。 而我想要做的就是简单地捏和ImageView的缩放功能。

I have to display image in an imageview. And what I want to do is just simply pinch and zoom functionality on imageview.

推荐答案

以下链接,由Jason Polites创建一个类,将允许您处理捏缩放定制ImageViews你可以找到:<一href="https://github.com/jasonpolites/gesture-imageview">https://github.com/jasonpolites/gesture-imageview.

You can find below a link to a class created by Jason Polites that will allow you to handle pinch zooms on custom ImageViews: https://github.com/jasonpolites/gesture-imageview.

只是包含这个包到您的应用程序,然后你就可以使用自定义的 GestureImaveView XML文件中的:

Just include this package into your application and then you will be able to use a custom GestureImaveView in your XML files:

<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"/>

本类处理捏缩放,而且双水龙头。

This class handles pinch zooms, but also double taps.

这篇关于如何捏在图像缩放的Andr​​oid变焦图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆