如何显示的图像比手​​机屏幕尺寸更大? [英] How to display an image that is bigger than the phone screen dimensions?

查看:138
本文介绍了如何显示的图像比手​​机屏幕尺寸更大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有没有找到一个真正的一致答案的问题。
这就是为什么我接触到你们。

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" /> 

您也可以使用 Horizo​​ntalScrollView 水平滚动条。

这篇关于如何显示的图像比手​​机屏幕尺寸更大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆