I have an ImageView
that contains an image. This image is getting scaled to fit within the screen because it's too large.
I'm trying to find out how much the image has scaled using getScaleY()
and getScaleX()
. This should return 1.0
if the image has not been scaled and return some value less than 1.0
if the image is scaled down to fit the view.
Instead, getScaleX()
and getScaleY()
alsways return 1.0
for me whether the image is scaled down or not.
You can see my XML here:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/docImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/dossier_cover"
android:adjustViewBounds="true"
android:padding="0dp"
/>
</RelativeLayout>
Does anyone know why this is happening? Or am I better off finding out the scale in a different way?