Skip to content Skip to sidebar Skip to footer

Showing A Full-width Imageview Containing A Svg Distorts It

My aim is to show a SVG background image filling the whole screen's width, in a ConstraintLayout. A Button is superposed to this background image, that's why you can see in the moc

Solution 1:

For the ImageView try setting android:scaleType="centerCrop". See ImageView.ScaleType.

CENTER_CROP Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop".

Post a Comment for "Showing A Full-width Imageview Containing A Svg Distorts It"