1
votes

i have built view controller with xib file and navigation bar in it,this view controller is shown in detail view of split view controller,i have design the xib from interface builder ,but when i rotate from landscape to portrait mode the navigation bar goes out of bound and little part is not shown in view.

how can i fix it. thanx in advance

1

1 Answers

1
votes

make uinavigationbar as variable in you view controller and connect to xib file ,then in you this function write

- (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;
}

hope this will help