【发布时间】:2017-10-26 00:52:19
【问题描述】:
我想使用捏合效果来放大和缩小图像。我可以缩小图像(即使图像在框架内变小)但我无法放大(即扩展框架可能是通过编程方式?
android 上的新手,所以对布局没有那么透彻的了解。 我使用了 github 库 Zoomage 但是我不太确定如何扩展图像帧以使其超出范围并进一步缩放..
我正在尝试做的可以在这里直观地看到
https://www.dropbox.com/s/qen6cqs3u0cq2n1/demo.mov?dl=0
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
.......some other layouts here
<LinearLayout android:layout_width="378dp"
android:layout_height="341dp"
android:orientation="vertical"
android:padding="16dp"
tools:layout_editor_absoluteY="107dp"
tools:layout_editor_absoluteX="-4dp">
<com.jsibbold.zoomage.ZoomageView
android:id="@+id/songImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="1dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:zoomage_animateOnReset="true"
app:zoomage_autoCenter="true"
app:zoomage_autoResetMode="UNDER"
app:zoomage_maxScale="8"
app:zoomage_minScale="0.6"
app:zoomage_restrictBounds="false"
app:zoomage_translatable="true"
app:zoomage_zoomable="true"
tools:layout_editor_absoluteY="93dp" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
【问题讨论】:
标签: android android-layout android-xml android-constraintlayout