Thanks… I did get this working so a single build works the way I wanted on both iPhone 4 and iPhone 5 screens!
display.pixelHeight turned out to be much more reliable than actualContentHeight in my testing
In config.lua, I added the following BEFORE the information in application = {
local pWidth, pHeight = display.pixelWidth, display.pixelHeight local useHeight = 1136 print("Height: ".. pHeight) print("Width: ".. pWidth) if (pHeight \< 1000) then print("iphone 4") useHeight = 960 else print("iphone 5") end
And in the application = { content = {
width = 640, height = useHeight,
Then in main.lua when I wanted to use different graphics assets based on screen size:
local startScreen if (display.pixelHeight \< 1000) then startScreen = display.newImage("StartScreen.jpg",320,480) else startScreen = display.newImage("StartScreen5.jpg",320,568) end
Hope that is helpful to anyone looking for this informatoin! I did lots of searching to try and find out how to support both screen sizes in a single build in Corona. Using this method, you could position text/buttons/tableviews/anything you need separately for each device size.