在滚动视图启用变焦 [英] Enabling zoom on scroll view
本文介绍了在滚动视图启用变焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一定的数据摆在我的滚动型
。我想,以使其能够放大/缩小。它包含简单的的ImageView
和的TextView
。
任何建议将是有益的。 谢谢你。
下面是我的code:
<滚动型
机器人:ID =@ + ID / viewSoupMenu
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:背景=@可绘制/ soupback>
<的LinearLayout
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:方向=垂直>
<的LinearLayout
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:方向=横向
机器人:layout_marginTop =50dp>
<的ImageButton
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_marginLeft =35dp
机器人:layout_marginTop =30dp
机器人:背景=@机器人:彩色/透明
机器人:SRC =@可绘制/ flowericon/>
<的ImageButton
机器人:ID =@ + ID / btnVegClearSoup
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_marginLeft =5DP
机器人:layout_marginTop =20dp
机器人:背景=@机器人:彩色/透明
机器人:SRC =@可绘制/ btnvegsoupclearclickedxml/>
< / LinearLayout中>
< /滚动型>
解决方案
尝试使用的FrameLayout
键,看看这个官方文档:的缩放视图。
I have certain data in placed in my ScrollView
. I want to enable it to zoom in/ zoom out. It contains simple ImageView
and TextView
.
Any suggestions will be helpful. Thank you.
Here is my code:
<ScrollView
android:id="@+id/viewSoupMenu"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/soupback" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="50dp">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginTop="30dp"
android:background="@android:color/transparent"
android:src="@drawable/flowericon" />
<ImageButton
android:id="@+id/btnVegClearSoup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="20dp"
android:background="@android:color/transparent"
android:src="@drawable/btnvegsoupclearclickedxml" />
</LinearLayout>
</ScrollView>
解决方案
Try using FrameLayout
and have a look at this official document: Zooming a View.
这篇关于在滚动视图启用变焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文