I have an ImageView defined as follows in XML. It's inside a custom ViewPager.
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView"
android:scaleType="fitXY"/>
It is working like a charm but I need to know the actual height of the image, after it has been scaled. I am taking the values in the onMeasure method of the custom ViewPager, like this:
View child = getChildAt(0);
child.measure(widthMeasureSpec, MeasureSpec
.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int h = child.getMeasuredHeight();
The height I am getting is not the height of the image scaled, it's the original size of the image before been scaled.
Thanks.