Best dimension to put in the background Android app?

Asked

Viewed 117 times

0

I developed a splash for an android app and included a background image via the command:

android:background="@drawable/bg16"

The image appeared, but due to its dimensions, it was somewhat flattened. Is there any standard dimension for images in Android apps?

1 answer

1


You probably need one Nine-Patch. It’s basically a PNG file in which you specify two-dimensional regions that can be stretched:

Examplo de uma imagem NinePatch utilizada em um botão

Extracted from the documentation on the support to screens of different sizes:

If your UI uses bitmaps that need to fit the size of a view Even after the system Scales the layout (such as the background image for a button), you should use Nine-Patch bitmap files. A Nine-Patch file is Basically a PNG file in which you specify two-dimensional Regions that are stretchable. When the system needs to Scale the view in which the bitmap is used, the system stretches the Nine-Patch bitmap, but stretches only the specified Regions.


Nine-Patches can be created with Draw 9-patch tool included in Android Studio.

  • 1

    Thanks Cassio for the clarification. I will be accessing the link you gave me.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.