我有一个图像的大小是320x210,是从xml文件中的drawable中调用的图像。在纵向模式中可以正常运行,但是当我改变设备的方向为横向模式时,图像的大小就不能符合。如何解决这个问题?
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"(here i tried with "fitXY" also)
android:adjustViewBounds="true"
android:src="@drawable/srkpic"/>
我也使用方法 protected void onSizeChanged(int w, int h, int oldW, int oldH) { }
,但是这个方法只有在继承 View 时才能用。