Linked questions
The below questions couldn't finally solve my problem, described below.
- Android: Is it possible to repeat an (SVG!) drawable inside an ImageView?
- Android: Keep ratio for a full-width and undefined height ImageView in a ConstraintLayout?
- Showing a full-width ImageView containing a SVG distorts it
Context
I use a ConstraintLayout. My aim is to show an SVG image which contains a button:
Its width is 100% the screen's width - it must be repeated
Its height is defined to be the space between the bottom side of a widget and the bottom side of the button - it must be repeated
The problem
Each time I tried to show this image, either the drawable was badly scaled, badly cropped or blurred.
An exemple is:
It should look like this:
Many tests
I have tried to use an
ImageViewwith the attributesrc: I used every scale type, with and without the attribute that allows to set a custom ratioI have tried to use an
ImageViewwith a background instead ofsrcI have tried to use a
RelativeLayoutwith a background drawable file that is repeated: so I didn't use an SVG image but its JPEG version, and even this way has resulted in bad resultsNota for 3.: I'd really want to use an SVG image instead of a bitmap one, because it will be resolutions-compliant.
My question
So, given all these explanations (cf.: part Context) and given the above illustrations, how would you proceed to show this image?


use java code