我制作了一个支持法语和英语的iPhone应用程序。当应用程序加载时,最初会出现黑屏。取而代之的是,我想为法语和英语添加闪屏。这两个启动屏幕是不同的。当语言是法语时,它将加载法语闪屏,当语言是英语时,它将加载英语闪屏。
简单地说,我如何为英语和法语添加Default.png?
请让我知道是否有任何方法来实现这一点。
发布于 2010-12-21 15:39:18
您可以动态加载通用屏幕,然后将其与您的语言特定屏幕之一切换。您可以使用以下代码:
将此代码添加到您的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
在你的didFinishLaunchingWithOptions
中这样做:
SwitchDefault * switch = [[[SwitchDefault alloc] init] autorelease];
[window addSubview:navigationController.view];
[window addSubview:switch.view];
[window makeKeyAndVisible];
发布于 2011-07-22 00:38:17
有点晚了。您可以本地化Default.png文件。有关步骤,请参阅http://www.skylarcantu.com/blog/2009/08/19/localization-your-iphone-os-applications-in-xcode/ (链接中的步骤适用于文本文件,但也可以对图像执行相同的操作)。
我已经使用这种方法创建了本地化的应用程序图标,并且工作得很好。
https://stackoverflow.com/questions/4497070
复制相似问题