Im trying to change an image lager than the screen so that the image partly(boundary parts) gets out of the screen. The purpose Im doing this is to make the whole screen filled with the image. I tried simply changing the height and width bigger than the height and width of screen which I got but it didn’t work well. I used code below to get the size of the screen.
val displayMetrics = DisplayMetrics() windowManager.defaultDisplay.getMetrics(displayMetrics) val height = displayMetrics.heightPixels val width = displayMetrics.widthPixels
How should I do for this?
In the xml match the height and width of the image to parent and change the
scaleType attribute to centerCrop ->
Answered By – Justin