I’m not sure if this is a bug of display.
Some screen settings in config.lua in certain devices will make the display object behave differently.
When I create the display rect with display.contentWidth and display.contentHeight, the rect may not be able to cover the full screen
config.lua
[lua]
local screenWidth = 640
local heightRatio = display.pixelHeight/display.pixelWidth
local screenHeight = screenWidth*heightRatio
application =
{
content =
{
width = screenWidth,
height = screenHeight,
fps = 60,
antialias = true,
xAlign = “center”,
yAlign = “center”,
},
}
[/lua]
main.lua
[lua]
local bg = display.newRect(display.contentWidth * 0.5, display.contentHeight * 0.5, display.contentWidth * 2, display.contentHeight * 2)
local rect = display.newRect(0, 0, display.contentWidth, display.contentHeight)
rect.anchorX = 0
rect.anchorY = 0
rect:setFillColor(1, 0, 0)
[/lua]
When I set the screenWidth in config.lua to 320, 640 or 1080 and run the code in iPhone 6, a white line will present at the bottom of the screen.
Is there any suggestion to avoid this?
Thanks for the help