2012-11-21 5 views
0

PhoneGap 1.0을 해킹하여 iPhone5에서 올바른 스플래시 화면을 표시하도록하는 방법이 있습니까?PhoneGap V1.x로 iPhone5 - 스플래시 스크린을 표시하는 방법

나는

if(navigator.splashscreen) navigator.splashscreen.hide(); 

로되는 SplashScreen을 설정 제어 할 수 있지만 아이폰 5에 잘못된 이미지를 보이고있다. [email protected] 이미지를 보여줘야합니다. PG2에서이 문제는 수정되었지만 전체 프로젝트를 업데이트하지 않으려합니다.

답변

1

이전 Phonegap에서이 문제를 해결하는 방법을 알아 냈습니다. 매우 쉬운 방법입니다.

UIImage* image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]]; 
imageView = [[UIImageView alloc] initWithImage:image]; 
[image release]; 

을이 교체 : PhoneGapDelegate.m,이를 찾아 몇 가지 이유를 들어

UIImage* image; 

if ([[UIScreen mainScreen] bounds].size.height == 568.0f) 
{ 
    image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"[email protected]" ofType:@"png"]]; 
} 
else 
{ 
    image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]]; 
} 
imageView = [[UIImageView alloc] initWithImage:image]; 
[image release]; 

을, 당신은 위의 코드처럼 아이폰 5 이미지에 대한 전체 이미지 이름을 지정해야합니다. @ "Default-568h"로 지정하면 이미지가 전혀로드되지 않습니다.

+0

안녕하세요, 쿨 - thnx! 최대한 빨리 시도하겠습니다! – headkit

+0

이 코드 스 니펫이나 프로젝트 내의 파일을 찾을 수 없습니다. – headkit

+0

파일은 PhoneGapLib/Classes 폴더 안에 있어야합니다. PhoneGapLib는 기본적으로 PhoneGap을 설치 한 곳입니다. Mac에서는 문서 폴더라고 생각합니다. Spotlight에서 PhoneGapLib을 검색하면 그 위치가 표시됩니다. – Marconelly

관련 문제