0

I have a button that I am loading a drawable for. The image was way bigger than the button so I resized the image to 38 by 38 pixels (actual resize not code or xml). Now, when I load the image then it looks good. I am worried about different screen sizes, if the screen is smaller and my button becomes smaller, the drawable will cross its boundries right? How can I fix it thanks a lot

PS: I read the android best practices page but I was wondering if there is a method other than replicating the same image in 3 different folders with different sizes

Snake
  • 14,228
  • 27
  • 117
  • 250

1 Answers1

0

I guess you already know this from reading the best practices, but perhaps you could use a 9-patch image. It does not suit all situations, but if you have an image that you simply want to extend the edges of, it is the way to go.

If you can't use 9-patch for the specific type of image, try your image on a couple of different screen sizes in the emulator before you get worried about it :). My experience is that drawables will scale quite well by default.

andrrs
  • 2,289
  • 3
  • 17
  • 25