我试图在横向模式下放置两个图像,因为我的应用程序将以横向模式穿过。当我在做下面的代码时,android在potrait模式下工作正常,但是在横向模式下,它确实按照比例拉伸,但保持不变。我应该怎么做,使之由AndroidAndroid没有在横向模式下自己拉伸布局
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
android:id="@+id/frameLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_gravity="center_horizontal" >
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/hud" />
android:id="@+id/frameLayout2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_gravity="center_horizontal">
android:id="@+id/imageView2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:src="@drawable/bg" />
+0
不相关,但不应该混合'fill_parent'和'match_parent'。如果您的API为1.6+,请使用'fill_parent'。如果您的API为2.1+,请使用'match_parent'。 –
2012-02-14 14:24:58
+0
使用LinearLayout而不是FrameLayout,那么你也应该使用android:layout_weight =“1”来更好地理解外观[here](http://developer.android.com/resources/tutorials/views/hello-linearlayout.html) –
2012-02-14 14:27:49
+0
什么你想要做什么?你想修改风景模式的布局吗?还是想用ImageView做其他事情?最佳实践 –
2012-02-15 12:55:26