Skip to content Skip to sidebar Skip to footer

Android: OS Not Re-sizing Images With The Same Scale

I am troubled by how the Android OS is handling resizing on an app of mine. Basically I have a background image that is 480x800 (so 480px wide) and an image that goes at the bottom

Solution 1:

You'll have to post your XMLs to get a more specific answer but basically all "Views" may handle image scaling differently.

In your example,

You can make your button stretch all the way by using width = match-parent.

"Backgrounds" will stretch by default, but can also tile. "Buttons" will have a min size of the background size but will stretch when needed (button has too much text)

As a side note, you shouldn't depend on the exact pixels of the images. You should look into nine-patch or making tiled backgrounds and make sure you take advantage of things like "match-parent, gravity, etc."


Post a Comment for "Android: OS Not Re-sizing Images With The Same Scale"