I upload an image and dynamically set it as the background of the screen using Imageview . I tried ScaleType to scale the image.
If the image height is greater than the width, then ScaleTypes fitStart , fitEnd and fitCenter do not work. Android will take the photo and place it depending on the height, but I see additional empty space as part of the width.
I want to zoom out the photo so that it matches the width, and I don't care if there is some extra blank space as part of the height or if the height is too long, is it okay if it comes out (if possible?).
ScaleType.XY scale the photo and fit everything into Imageview and does not care about the ratio of the height and weight of the image.
<ImageView android:id="@+id/background" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="fitStart" />
android android-layout android-imageview
Sharj Aug 21 '12 at 16:35 2012-08-21 16:35
source share