2

このクラスを使用して、ズーム可能な相対レイアウトをアプリケーションに追加しています。そして私のレイアウトはこれです。

<com.example.zoomablerelativelayoutexample.ZoomableRelativeLayout
    android:layout_width="500dp"
    android:layout_height="500dp"
    android:layout_alignParentTop="true"
    android:background="#000" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="124dp"
        android:layout_marginLeft="64dp"
        android:layout_toRightOf="@+id/imageButton1"
        android:src="@drawable/ic_launcher" />

    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="52dp"
        android:layout_marginTop="131dp"
        android:src="@drawable/ic_launcher" />

</com.example.zoomablerelativelayoutexample.ZoomableRelativeLayout>

メインの xml のスクリーン ショットを次に示します。

ここに画像の説明を入力

問題はこれです。RelativeLayoutでピンチズームすると普通にズームします。そして、レイアウトを移動するときにズームしたら無限に動きます。

ここに画像の説明を入力 ここに画像の説明を入力

moveイベントを境界線で制限したい。どうすればいいですか?

4

0 に答える 0