Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2343] iPhone5 & iPad : can't access Default Splash Screen resources from MainBundle

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-05T23:21:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsAPI, Titanium, default.png, i0S
ReporterVincent
AssigneeShak Hossain
Created2012-11-10T10:46:00.000+0000
Updated2016-03-08T07:41:22.000+0000

Description

if you want to load the Default png from the MainBundle, for example to use as a background for one of your window /view this will work only for 3.5 inches iPhones not for iPhone 5 and iPad. in TiUtils.m :
+(UIImage*)loadBackgroundImage:(id)image forProxy:(TiProxy*)proxy
we have the special case ( around line 1632)
 if (resultImage==nil && ( [image isEqualToString:@"Default.png"] ))
        {
            // special case where we're asking for Default.png and it's in Bundle not path
            resultImage = [UIImage imageNamed:image];
        }
which will work only for legacy iPhones. same special case in UIModule.m (around line 192)
-(void)setBackgroundImage:(id)image
my solution was to rewrite the special case like this ,in both methods (dirty)
if (resultImage==nil && ([image isEqualToString:@"Default.png"]||[image hasPrefix:@"Default-"]))
	{
		// special case where we're asking for Default.png and it's in Bundle not path
		resultImage = [UIImage imageNamed:image];
	}

Comments

  1. Shak Hossain 2014-01-17

    Hi Vincent, It has been long since the ticket was last updated. We have not heard back from you further. Can you please let me know if this is still an issue for iPhone 5 and iPad. If so, please post a complete test case and we will review at the earliest. If we don't hear back from you, we will assume the issue is invalid and close the ticket. Thanks,

JSON Source