이전 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"로 지정하면 이미지가 전혀로드되지 않습니다.
안녕하세요, 쿨 - thnx! 최대한 빨리 시도하겠습니다! – headkit
이 코드 스 니펫이나 프로젝트 내의 파일을 찾을 수 없습니다. – headkit
파일은 PhoneGapLib/Classes 폴더 안에 있어야합니다. PhoneGapLib는 기본적으로 PhoneGap을 설치 한 곳입니다. Mac에서는 문서 폴더라고 생각합니다. Spotlight에서 PhoneGapLib을 검색하면 그 위치가 표시됩니다. – Marconelly