2014-03-14 30 views
0

使用導航控制器呈現的視圖控制器。當我呈現視圖導航欄高度爲65.並且當我旋轉設備導航欄與狀態欄重疊並且導航欄高度降低時64到44當設備旋轉時,導航欄高度從65減小到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; 
} 

我試圖設置導航欄的高度progrmatically像
[導航欄SETFRAME:cgrectmake(0,0,1024,65)]; 我也嘗試在xib文件中設置約束,並設置了以下屬性。我嘗試了在xib中設置約束和編程方式的所有方法。很糟糕的情況。

+0

當我試圖用nslog NSLog(@「Navbar Height%@」,NSStringFromCGRect(self.navigationController.navigationBar.frame))打印時; 它總是打印導航欄高度{{0,0},{1024,44}},但導航欄高度從第一次視圖旋轉時從65減少到44。但是所有時間nslog將打印導航欄的高度爲44 – iOSdev

+0

你有沒有找到這個問題的解決方案? – mAc

回答

1

在appdelegate中設置self.navigationcontroller.navigationbar.transculent = no它將修復所有問題,並在所有xib中推斷出xib文件selecte top bar。