Ipad 在详细视图控制器中调整导航栏的大小

Ipad 在详细视图控制器中调整导航栏的大小,ipad,uisplitviewcontroller,uinavigationcontroller,Ipad,Uisplitviewcontroller,Uinavigationcontroller,我已经构建了包含xib文件和导航栏的视图控制器,该视图控制器显示在拆分视图控制器的详细视图中,我已经从interface builder设计了xib,但是当我从横向模式旋转到纵向模式时,导航栏会超出范围,视图中没有显示一小部分 我怎样才能修好它。 thanx预先在视图控制器中将uinavigationbar作为变量,并连接到xib文件,然后在您的视图中写入此函数 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientat

我已经构建了包含xib文件和导航栏的视图控制器,该视图控制器显示在拆分视图控制器的详细视图中,我已经从interface builder设计了xib,但是当我从横向模式旋转到纵向模式时,导航栏会超出范围,视图中没有显示一小部分

我怎样才能修好它。
thanx预先

在视图控制器中将uinavigationbar作为变量,并连接到xib文件,然后在您的视图中写入此函数

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Override to allow orientations other than the default portrait orientation.
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {

    self.navigationBar.frame= CGRectMake(0, 175, 703,44);   


    } else {

    self.navigationBar.frame= CGRectMake(0, 175, 768,44)

    }
    return YES;
}

希望这将有助于

使uinavigationbar成为视图控制器中的变量,并连接到xib文件,然后在您的视图中编写此函数

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Override to allow orientations other than the default portrait orientation.
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {

    self.navigationBar.frame= CGRectMake(0, 175, 703,44);   


    } else {

    self.navigationBar.frame= CGRectMake(0, 175, 768,44)

    }
    return YES;
}
希望这会有所帮助