我有一个包含RelativeLayout和的私有类的活动,该活动扩展了SimpleOnScaleGestureListener。在onScale听众的方法中,我想通过用户展开/捏手指来放大/缩小整个布局(用户看到的一切)。
我想改变的布局不被永久的,即当病毒/捏合手势是在我想的布局回去这是什么在首位(任何复位可能在做onScaleEnd的方法SimpleOnScaleGestureListener例如)。
我试图通过调用setScaleX和setScaleY在上RelativeLayout以及还使用来实现它ScaleAnimation。两者均不会导致平滑缩放(或任何可能被称为缩放的东西)。甚至可以放大/缩小RelativeLayout?
我剩下的唯一想法是从缓存中读取屏幕截图,并将其作为ImageView整个布局的顶部,并通过放大/缩小此图像setImageMatrix。但是,我不知道如何实现这一点。
May布局还包含一个片段的容器,在应该进行缩放时该片段为空。通过该onScaleEnd手势,将片段放入其容器中(已经实现并且可以正常工作)。这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_pinch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff" >
<!-- Layout containing the thumbnail ImageViews -->
<LinearLayout
android:id="@+id/thumbnail_group_pui"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c2"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c3"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c4"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c5"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tn_c6"/>
</LinearLayout>
我没有实。我必须在扩展类中包括哪些其他方法来实际缩放布局或重置布局?
慕侠2389804
波斯汪
相关分类