【问题标题】:How to zoom two imageView with One Gesture?如何使用一个手势缩放两个 imageView?
【发布时间】:2013-01-04 02:57:30
【问题描述】:

我想将缩放手势传递给另一个 imageView 或使用捏缩放缩放两个 imageView....

我正在使用这个库https://github.com/jasonpolites/gesture-imageview

已经有缩放、平移、双击监听器......

现在我的目标是当我捏/缩放最顶层时,两个图像都将被缩放,包括它后面的图像......

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background" >

<com.polites.android.GestureImageView
    android:id="@+id/image_areas"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scaleType="fitCenter"
    android:src="@drawable/p2_ship_mask"
    android:visibility="invisible" />

<com.polites.android.GestureImageView
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scaleType="fitCenter"
    android:src="@drawable/p2_ship_default" />

</FrameLayout>

【问题讨论】:

    标签: android imageview zooming gestures


    【解决方案1】:

    您可以在缩放侦听器中从正在缩放的​​ImageView 获取缩放值,并将其设置为另一个ImageView 的值。

    【讨论】:

      【解决方案2】:

      知道了...我创建了设置第二个图像视图的比例和位置并重绘它的方法...

      这是我的代码....

                      imageAreas.setScale(iv.getScale());
                      imageAreas.setPosition(iv.getImageX(), iv.getImageY());
                      imageAreas.redraw();
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-08-17
        • 1970-01-01
        • 2018-12-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-10-03
        相关资源
        最近更新 更多