[TIMOB-1575] iPad - restarting a iPhone published app on ipad after using 2X mode, app uses incorrect icons
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:56:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Backlog |
Components | iOS |
Labels | 2x, defect, icon, ios, ipad, mode, patch |
Reporter | Thomas Huelbert |
Assignee | Blain Hamon |
Created | 2011-04-15T02:56:25.000+0000 |
Updated | 2011-04-17T01:56:33.000+0000 |
Description
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.
Attachments
File | Date | Size |
---|---|---|
ios-32-scaling-bug.jpg | 2011-04-15T02:56:26.000+0000 | 81654 |
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.
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.)
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.
Somebody in #titanium_app asked about this issue today. Would love to see the fix make it in!
(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...
[INFO] Titanium SDK version: 1.6.0 (01/12/11 14:54 ff401e1) ipad 3.2 wifi, 4.2 emulator
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.