2011-12-22 3 views
0

Работаю в приложении для iPad. У меня есть 4 изображения для экрана Splash (Landscape Right, Left и Portrait, PortraitUpsideDown). Когда я запускаю приложение в портретном режиме, экран Splash выглядит неплохо, но он меняет ориентацию на Landscaper. Экран Splash не меняет ориентацию. Не могли бы вы предложить мне какие-нибудь идеи? Сегодня мне нужно отправить приложение. Пожалуйста, помогите мне. Заранее спасибо. Вот мой код,Splash Screen не меняет ориентацию в iPad?

-(void) showSplash 
{ 
    UIInterfaceOrientation orientation= [[UIApplication sharedApplication] statusBarOrientation]; 
    if (orientation == UIInterfaceOrientationLandscapeLeft || 
     orientation == UIInterfaceOrientationLandscapeRight) // UIDeviceOrientationLandscapeLeft 
    {  
     NSLog(@"Splash Landscape"); 
     UIViewController *splash=[[UIViewController alloc] init]; 
     splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)]; 
     splachview.image=[UIImage imageNamed:@"Default-Landscape.png"]; 
     [splash.view addSubview:splachview]; 

     splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; 
     splachview.contentMode = UIViewContentModeTop; 

     [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; 
     [self presentModalViewController:splash animated:NO]; 
     [self performSelector:@selector(hideSplash) withObject:nil afterDelay:10.0]; 
     [splash release]; 
     [splachview release]; 
    } 
    else if (orientation == UIInterfaceOrientationPortrait || 
      orientation == UIInterfaceOrientationPortraitUpsideDown) // UIDeviceOrientationPortrait 
    { 
     NSLog(@"Splash Portrait"); 
     UIViewController *splash=[[UIViewController alloc] init]; 
     splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)]; 
     splachview.image=[UIImage imageNamed:@"Default-Portrait.png"]; 
     [splash.view addSubview:splachview]; 

     splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; 
     splachview.contentMode = UIViewContentModeTop; 

     [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; 
     [self presentModalViewController:splash animated:NO]; 
     [self performSelector:@selector(hideSplash) withObject:nil afterDelay:10.0]; 
     [splash release]; 
     [splachview release]; 
    } 
} 

Исправьте мою ошибку. Заставка не меняет ориентацию. Благодарю.

ответ

1

Имя файлы Всплеск как

Default-Landscape.png и Default-Landscape.png для IPad
Default.png' and По умолчанию @ 2x.png` для iPhone.

Помните, что имена файлов чувствительны к регистру, поэтому проверьте их дважды.

+0

Спасибо Mr.Saurabh. Я назвал их для всплесков экранов Default-LandscapeLeft.png, Default-LandscapeLeft.png, Default-Portrait.png, Default-PortraitUpsideDown.png. Это правильно или мне нужно изменить имя выше, чем вы упомянули. Пожалуйста, помогите мне. Сегодня мне нужно отправить приложение. Благодарю. –

+0

Еще одно уточнение. У меня есть два изображения для пейзажа справа и слева. Там мне нужно изменить имя. Пожалуйста, помогите мне. –

+0

Просто назовите их, как я уже говорил, и это должно сработать! – Saurabh