Question: I have one issue which i can't handle with it. I have two view controllers and I use `[[UIApplication sharedApplication] setStatusBarHidden:isHidden withAnimation:UIStatusBarAnimationSlide];` to show/hide status bar. All works pefect but I need one thing: everything is embed in navigation controller and after hiding status bar navigation bar is moving up for 20 px. How can I remove this effect? With or without status bar i want navigation bar at the same place in every time.

Edit1: I've already done this

```
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.layer.transform = CATransform3DIdentity;
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    self.navigationController.navigationBar.layer.transform = CATransform3DMakeTranslation(0, 20, 0);
}

```

It works but animation is terrible and i need something better.

Answer: 
There no clear way to do this, but you can set this thing by using following code in ViewDidLoad :

```
    CGRect statusFrame = CGRectMake(0.0, -20.0, 1024, 20);
    UIView* statusBar = [[UIView alloc] initWithFrame:statusFrame];
    statusBar.backgroundColor = [UIColor blackColor];
    [self.view addSubview:statusBar];
    [statusBar release];

```
When your status bar is hidden, the navigation bar automatically moves up to make up for the space.

If you set `UIViewControllerBasedStatusBarAppearance` to `YES`, it should stop that behaviour.