Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there.. I have an vector drawable that I have been using it for an ImageView inside my Project. Now I want to change the ImageView's height and width to custom dp but when i do it the content inside it also changes it's width and height. How can i change the ImageView's width and height without changing the height and width of the content inside it??????

What I have tried:

I have tried browsing the internet, edited xml file but no luck..
Posted
Comments
Richard MacCutchan 28-Jun-21 3:54am    
If you change the image size then the content will obviously change to match the new dimensions. What exactly are you trying to achieve here?
Proton Vpn 28-Jun-21 6:38am    
@Richard MacCutchan What exactly I am trying to achieve is that I want the ImageView's size bigger but the content in it should stay same size.
How can i do it..
Richard MacCutchan 28-Jun-21 6:45am    
Look at the scaling options in the documentation: ImageView  |  Android Developers[^].
David Crow 28-Jun-21 9:23am    
Have you tried adding padding to the ImageView?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900