我使用xib创建了两个xib,并设置了UIViews is LandscapeLeft的方向。
而不是将这段代码添加到
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

以下是我的理想结果:
ios 7状态栏下的窗口,3.最基本的培养条件是Autolayout是"TRUE“。
我的测试代码:https://www.dropbox.com/s/bj9wg4hwar1t8y0/statusbartesting.zip
有人能帮助解决这个问题吗?


发布于 2014-06-23 05:42:42
您不需要更改AppDelegate中的窗口框架。
我会告诉你密码,请遵循它
Appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
self.mxfirstciewcontroller = [[firstViewController alloc] initWithNibName:@"firstViewController" bundle:nil];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:self.mxfirstciewcontroller];
[(UINavigationController *)self.window.rootViewController setNavigationBarHidden:YES];
return YES;
}在firstViewController.m中
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.view setFrame:CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height)];
}在第二视图控制器中。
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self.view setFrame:CGRectMake(20, 0, self.view.frame.size.width, self.view.frame.size.height)];
}https://stackoverflow.com/questions/24358697
复制相似问题