0

I made app in iOS6. As I run on iOS7, it shows are

Navigation Bar issue

I tried this code, but no use.

[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];

nav.navigationBar.translucent = NO;

What should I do. My xib is like this

Inspector

Duaan
  • 609
  • 1
  • 13
  • 29

2 Answers2

0

add these lines of code in your viewDidLoad

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
    // iOS 7
    [self prefersStatusBarHidden];
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
    // iOS 6
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}

and define this method

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

This working for me.. Best of luck .. :-)

Amitabha
  • 1,664
  • 1
  • 12
  • 30
0

Add this two line in your viewDidLoad method

    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout=UIRectEdgeNone;
    if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)])
        self.automaticallyAdjustsScrollViewInsets=NO;

Hope this will help you.

Nikunj
  • 987
  • 11
  • 25