Issue
In one of our apps there is a splash screen during loding of app data. The customer have delivered the images which shoud be shown in the splash activity. All in all 6 images for 6 drawable sizes:
- ldpi (240x320)
- mdpi (320x480)
- hdpi (480x800)
- xdpi (640x960)
- xxdpi (960x1440)
- xxxdpi (1280-1920)
The problem is that some devices fall outside these ratios. For example Samsung Galaxy S4 and it's 'Active' model both have screen size of 1080x1920 which falls between these ratios thus squizzing the image to fit the view as can be seen in the screenshot where the image is squizzed horizontally.
What can I do? Where can I place a 1080x1920 image outside these 6 drawables?
Solution
Galaxy S4 (1080×1920) takes the xxhdpi drawable. The screen aspect ratio is 9:16, but the given drawable is of 2:3, hence the stretch.
We have hundreds of different screen resolutions out there, so you can't really satisfy them all.
I can think of:
- stretching the drawable as you already did losing the original aspect ratio,
- cropping/shrinking the drawable with a different
ScaleType
(FIT_XY
is default inImageView
) which might look ugly, - or using
nine-patch
if both options are unacceptable.
With option #2, you may go with ScaleType.CENTER_INSIDE
and set a plain background with a greenish color for example.
Answered By - Attacktive
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.