当设备旋转时,导航栏高度从65减少到44

时间:2014-03-14 05:56:31

标签: ipad ios7 uinavigationbar

使用导航控制器显示控制器。当我显示导航栏高度为65时。当我旋转设备导航栏与状态栏重叠时,导航栏高度从64减少到44.

CreateTableViewController * create = [[CreateTableViewController alloc] initWithNibName:@"CreateTableViewController" bundle:nil];
createNotif.notifDelegate = self;
UINavigationController *navbar= [[UINavigationController alloc] initWithRootViewController:create];
if([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0)
{
    [navbar.navigationBar setFrame:CGRectMake(0, 0, 320, 64)];
    [self presentViewController:navbar animated:YES completion:nil];
}    
if([[[UIDevice currentDevice] systemVersion]floatValue ] >= 7.0)
{
    self.extendedLayoutIncludesOpaqueBars = NO;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.navigationBar.translucent=NO;
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;
}

我试图像导线一样设置导航栏的高度    [navbar setframe:cgrectmake(0,0,1024,65)]; 我也尝试在xib文件中设置约束并设置以下属性。我已经尝试了所有在xib和programatically中设置约束的方法。非常糟糕的情况。

1 个答案:

答案 0 :(得分:1)

在appdelegate中设置self.navigationcontroller.navigationbar.transculent = no它将解决所有问题,并且在xib文件中选择顶部栏是在所有xib中推断的。

相关问题