I am building a universal app. I ran it in the simulator and have put in specific code to scale the app in my code. In the simulator
system.getinfo("model") -- returns "iPhone4" for the iPhone4 device simulator
On an actual iPhone4 device system.getinfo("model") -- returns "iPhone". As a workaround I have put an extra option in my if statement that checks if it is "iPhone" and display.contentWidth == 640 then I assume the device is an iPhone 4. This works.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
system.getInfo("model") == "iPhone4" works on simulator but not on device
Nice, thanks!
1 2 3 4 5 6 7 | -- iPhone 4 Specific isiPhone4 = false if(system.getInfo("model") == "iPhone" and display.contentWidth == 640)then isiPhone4 = true end |
Something else others should be aware of, the Simulator WINDOW menu for "View As" lists "NexusOne" with no space, but the API call returns "Nexus One". "Galaxy Tab" is consistent though. Just a heads-up when using system.getInfo("model")
That looks like a bug on the Mac Simulator. iPhone4 skin should return the same string as on an actual device, "iPhone". I'll file a bug to have it fixed. Thanks.
views:1452 update:2011/10/11 22:13:38
热门文章
GameCenter LeaderBoards and Achievements Enabled Through OpenFeint
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
相关文章
Timer/Stopwatch Not Accurate/Precise - Slow
Sprite error
Current position of audio file
Audio con Storyboard
velocity and direction problem
New: Mobile Lime API
Odd problem with suspending and resuming
OpenFeint's Free Game of the Day - Shoot The Block
Xcode: MinimumOSVersion functionality - menu?
Why does this line terminate?
Sprite error
Current position of audio file
Audio con Storyboard
velocity and direction problem
New: Mobile Lime API
Odd problem with suspending and resuming
OpenFeint's Free Game of the Day - Shoot The Block
Xcode: MinimumOSVersion functionality - menu?
Why does this line terminate?
corona forums © 2003-2011