Runtime splash screen iPhone

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

I made a iPhone application which supports French and English languages. When application is loading there is black screen appears initially. Instead of this I want to add splash screens for French and English. Both splash screens are different. When language is French it will load French splash screen and when language is English, it will load English splash screen.

In simple words, How I add Default.png for English and French?

Please let me know if there is any way to implement this.

回答1:

You can dynamically load a universal screen, then switch it up with one of your language specific screens. You can play with this code:

Add this to your AppDelegate.m

@interface SwitchDefault : UIViewController {} @end @implementation SwitchDefault  - (void)viewDidLoad {     [super viewDidLoad];      /* use an if statement here to display a specific French / English spash  */      UIImageView *switch = @"English.png";         self.view = switch;        [UIView beginAnimations:nil context:nil];     [UIView setAnimationDuration:2.0];     [UIView setAnimationDelegate:self];     [UIView setAnimationDidStopSelector:@selector(imageDidFadeOut:finished:context:)];     /*  add a fade into your app  */     [UIView commitAnimations];  } - (void)imageDidFadeOut:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{     [self.view removeFromSuperview]; } @end

And in your didFinishLaunchingWithOptions do thig:

SwitchDefault * switch = [[[SwitchDefault alloc] init] autorelease]; [window addSubview:navigationController.view]; [window addSubview:switch.view]; [window makeKeyAndVisible];


回答2:

A bit late. You can localize the Default.png file. See http://www.skylarcantu.com/blog/2009/08/19/localization-your-iphone-os-applications-in-xcode/ for the procedure (procedure in link is for text files, but same can be done for images).

I've created localized app icons using this method, and works perfectly.



转载请标明出处:Runtime splash screen iPhone
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!