如何显示的图像比手机屏幕尺寸更大?
我有没有找到一个真正的一致答案的问题。
这就是为什么我接触到你们。
I have a question that I didn't find a real consistent answer for. That is why I am reaching out to you guys.
我一直想实现我在下面的意义上应用程序中的取景器的效果:
I've been trying to achieve a 'viewfinder' effect for my application in the following sense:
我有,我希望能够飞过的巨幅照片(水平和放滚动;垂直,直到我到达边界)。到目前为止,所有流行的答案,这个(或类似的问题)是使用类似于这样的一个模式:
I have a huge picture that I want to be able to "fly" over (scroll horizontally & vertically until I reach the boundaries). So far, all the popular answers to this (or similar questions) is to use a schema that resembles something like this:
<ScrollView...>
<RelativeLayout ...>
<Imageview ...>
</Imageview>
</RelativeLayout>
</ScrollView>
这不适合我的工作,因为它的比例缩小的,我试图保持在原来的 BIG 的大小,这样我可以让用户浏览图像在它。
This does not work for me, because it scales down the picture that I'm trying to keep at the original BIG size so that I can let the user navigate over it.
我想我的问题归结为: 如何让谷歌地图滚动使用的是Android视图和布局的功能,如果可能的话...如果没有,你有建议吗?我应该前往更倾向于2D画布操作? 的
I guess my question boils down to this: how to get the Google Maps scroll feature using Android Views and Layouts if at all possible... If not, do you have a suggestion? Should I head more towards 2D Canvas operations ?
感谢您。
您可以指定 scaleType
来中心的ImageView
不缩放图像。
You can specify the scaleType
to center for ImageView
to not to scale the image.
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/myImage" />
您也可以使用 HorizontalScrollView
水平滚动条。