0

我必须针对 iPhone 5 屏幕尺寸优化我的一个旧项目。RootViewController 没有 XIB。我在应用程序 didFinishLaunchingWithOptions: 方法中尝试了一些技巧。但没有任何效果。

这是应用程序 didFinishLaunchingWithOptions: 方法的代码。** 注意:注释行是我尝试过的技巧

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self createEditableCopyOfFileIfNeeded:@"ChapterInfo.plist"];



mainWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

//    [mainWindow  setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
//    [mainWindow setAutoresizesSubviews:YES];


readerDemoController = [[ReaderDemoController alloc] initWithNibName:nil bundle:nil]; // Demo controller

//    [readerDemoController.view setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
//    [readerDemoController.view setAutoresizesSubviews:YES];

navigationController = [[UINavigationController alloc] initWithRootViewController:readerDemoController];

UIImage *imgeBack = [UIImage imageNamed:@"back.png"];
mainWindow.backgroundColor = [UIColor colorWithPatternImage:imgeBack]; // Window background color

navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
[navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"titlebar.png"] forBarMetrics:UIBarMetricsDefault];
navigationController.navigationBar.translucent = YES;

//    [navigationController.view setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
//    [navigationController.view setAutoresizesSubviews:YES];

mainWindow.rootViewController = navigationController; // Set the root view controller

[mainWindow makeKeyAndVisible];


return YES;
}

如果不从一开始就进行项目,我该如何克服这个问题?请给我一些帮助。

4

1 回答 1

2

据我了解,您处于信箱模式,一直有 2 条黑色条纹(顶部一条,底部一条,纵向模式),如果是这样 - A-Live 是正确的,只需添加正确splashscreen 1136x640 72dpi png,命名为 Default-568h@2x.png 或者只是在有关丢失图像的警告中进行自动修复。

于 2013-07-15T23:53:10.957 回答