Android Question Add background image to the layout

Sanxion

Active Member
Licensed User
Longtime User
Hi

What is the preferred method of adding a background image to the entire layout - in such a manner than it scales itself correctly for different screen sizes and orientations?

Thanks in advance!
 

sorex

Expert
Licensed User
Longtime User
you either have

parts not being displayed but screen filled (scaled right but beyond screen borders)
parts around the image being black (scaled right by ratio but not covering everything)
screen completely filled (scaled wrong depending on ratio picture vs screen, overstretching)

the problem is the large amount of different devices. some devices only have half the height of newer models which makes it hard to apply the right scaling.

so you better keep this in mind when you design a background picture (keep the important stuff in the center as the rest might drop off depending on the method)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
you either have

parts not being displayed but screen filled (scaled right but beyond screen borders)
parts around the image being black (scaled right by ratio but not covering everything)
screen completely filled (scaled wrong depending on ratio picture vs screen, overstretching)

the problem is the large amount of different devices. some devices only have half the height of newer models which makes it hard to apply the right scaling.


=


you cannot obtain a perfect image in any "rectangle"



:D
 
Upvote 0
Top