android纵向/横向页面视图中背景图像的滚动视图

android纵向/横向页面视图中背景图像的滚动视图,android,android-layout,Android,Android Layout,我试图创建一个布局,在纵向模式下,图像适合屏幕。 但是,在横向模式下,我只希望宽度被拉伸到屏幕大小 以及要滚动的(图像)高度。图像的宽高比不应改变 我的问题是,我似乎永远无法得到一个滚动条,我的图像总是垂直挤压 这是我的xml文件: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="

我试图创建一个布局,在纵向模式下,图像适合屏幕。 但是,在横向模式下,我只希望宽度被拉伸到屏幕大小 以及要滚动的(图像)高度。图像的宽高比不应改变

我的问题是,我似乎永远无法得到一个滚动条,我的图像总是垂直挤压

这是我的xml文件:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/meep" >
</ScrollView>

如何更改此代码,使图像保持纵横比和垂直滚动条
出现?

无论采用何种方式,您可能希望使用两种不同的布局:一种用于纵向,另一种用于横向。这可能比在两种模式下制作一个布局功能更容易。请参阅:我使用了两种不同的布局。我的肖像显示了整个屏幕,并按预期工作,但我希望我的横向布局中的图像是可滚动的。上面的xml文件用于横向模式。