When displaying a background, AndEngine produces black bars above the image on certain devices. How do I support variable screen ratios for different devices using AndEngine?
I believe what you're asking is how to get rid of letterboxing, like this:
By default, AndEngine assumes you want some fixed aspect ratio. It then uses letterboxing to handle devices with different display aspect ratios then what you're providing. The advantage is you have certainty about your layout.
There's more than one approach to get rid of them, but here's what I do. The following code takes a fixed height (in this case 320) and adjusts the width based on the aspect ratio of the device.
|show 10 more comments|
I used CropResolutionPolicy, a new policy developed by Martin, check it out here http://android.kul.is/2013/10/andengine-tutorial-dealing-with-screen-sizes.html