[TIMOB-1575] iPad - restarting a iPhone published app on ipad after using 2X mode, app uses incorrect icons

GitHub Issuen/a
Resolution Date2011-04-17T01:56:33.000+0000
Affected Version/sn/a
Fix Version/sBacklog
Labels2x, defect, icon, ios, ipad, mode, patch
ReporterThomas Huelbert
AssigneeBlain Hamon


you can use the resources folder associated with http://developer.appcelerator.com/helpdesk/view/31431">http://developer.appcelerator.com/helpdesk/view/31431 to reproduce the issue.

issue reported as http://developer.appcelerator.com/helpdesk/view/32681#c162321">http://developer.appcelerator.com/helpdesk/view/32681#c162321

1.Publish the app as an mobile app
2.install on an ipad
3.launch app, note appearance of the icon in the title bar (right)
4.tap 2X, quit the app (hit home button)
5.relaunch app and look at the icon

results: after going 2X mode, quit and relaunch the app is using the incorrect icon.




  1. Brion Vibber 2011-04-15

    The problem here seems to be that the UIScreen reports a scale factor of 2.0 when running on iPad at 2x mode, so [TiUtils isRetinaDisplay] gives a false positive and [TiUtils checkFor2XImage:] pulls the @2x images.

    The problem doesn't show up when starting non-zoomed because the scale factor is 1.0 at the time the image gets loaded, so the low-res version is retrieved as expected.

  2. Brion Vibber 2011-04-15

    The scale property on UIScreen is documented to only exist in iOS 4, so I'm not sure it should be responding on an iPad running 3.2.2... but it is.

    Need to disregard that if we're running in iPhone compat mode on an iPad, I guess... or else make sure that the high-res images get displayed at the proper scale! (However this will usually not be great behavior, since the zoom can change during runtime so any already-loaded images will end up wrong.)

  3. Brion Vibber 2011-04-15

    Here's my proposed fix:

    http://github.com/brion/titanium_mobile/commit/c35f0fb2f6241cad27d2825924a6c695df37977c"> http://github.com/brion/titanium_mobile/commit/c35f0fb2f6241cad27d2...

    When checking the scale, this double-checks if we're on an iPad but with a UI_USER_INTERFACE_IDIOM() for iPhone mode; if so, then we pretend we're on 1x scale instead of checking the reported value.

    In native iPad mode we'll still check the scale, so it should still support automatic use of @2x images on a hypothetical future iPad with a double-density display.

  4. Brion Vibber 2011-04-15

    Somebody in #titanium_app asked about this issue today. Would love to see the fix make it in!

  5. Jeff Haynie 2011-04-15

    (from [03bff3242c76f0b30a794107e13cf74624408cf2]) [#1575 state:fixed-in-qa] Based off the commit brion made, checks if the iPad is incorrectly returning a 2x scale. Also, some unnecessary conditional compiles removed. https://github.com/appcelerator/titanium_mobile/commit/03bff3242c76f0b30a794107e13cf74624408cf2"> https://github.com/appcelerator/titanium_mobile/commit/03bff3242c76...

  6. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/12/11 14:54 ff401e1) ipad 3.2 wifi, 4.2 emulator

  7. Travelin_G 2011-04-15

    Not sure if I'm missing something here - but I downloaded/installed the continuous 1.6 build dated 1/14/11 (mobilesdk-1.6.0-20110114221541-osx.zip), installed & compiled and I'm still seeing the same bug.

JSON Source