android图像视图大小不随图像缩放

我有以下 android布局:
<?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)

有没有办法让图像视图的大小与图像的缩放大小完全匹配?

解决方法

它看起来类似于这个问题: Android ImageView size not scaling with source image,解决方案是将android:adjustViewBounds =“true”添加到ImageView

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...