-3

I'm developing the android app to display image banner when you open the app on android mobile.

The problem is, image banner is stretching on different android devices based on the resolution of the phone. This resulted, image-banner get too much stretched.

How to get Responsive image banner on Android app?

arjun
  • 197
  • 1
  • 1
  • 12

1 Answers1

0

Take different size images in different drawable folders in res folder with same name.

There is a 3:4:6:8 scaling ratio in drawable size by DPI.

LDPI - 0.75x   
MDPI - Original size  
HDPI - 1.5x  
XHDPI - 2.0x  
XXHDPI - 3x  
XXXHDPI - 4.0x   
   ​

For example if a 100x100 image is a baseline (MDPI),

LDPI - 75x75 
HDPI - 150x150       
XHDPI - 200x200  
XXHDPI - 300x300  
XXXHDPI - 400x400  

and so on.

Piyush
  • 18,895
  • 5
  • 32
  • 63
mInE.....
  • 143
  • 11