我有以下的安卓布局:
图像会缩小很多,但由于保持了宽高比,因此只占屏幕的上半部分。
问题在于图像视图本身具有原始高度,这需要整个屏幕来显示,文本从未显示出来。
(所以原始图像大约为620 X 430,缩放后的图像大约为250 X 200,但图像视图大约为250 X 430)
有没有办法让图像视图的大小完全匹配图像的缩放大小?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainTopLevel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/orbitImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:scaleType="fitStart"
android:src="@drawable/earthorbit"
android:padding="0dp"
android:background="@android:color/white"
/>
<TextView
android:id="@+id/positionDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="40dp"
android:layout_below="@id/orbitImage"
android:text="should appear below image"
/>
</RelativeLayout>
图像会缩小很多,但由于保持了宽高比,因此只占屏幕的上半部分。
问题在于图像视图本身具有原始高度,这需要整个屏幕来显示,文本从未显示出来。
(所以原始图像大约为620 X 430,缩放后的图像大约为250 X 200,但图像视图大约为250 X 430)
有没有办法让图像视图的大小完全匹配图像的缩放大小?