L
L
lubimow2013-09-27 16:10:32
iOS
lubimow, 2013-09-27 16:10:32

Status bar is not hidden in iOS 7?

I wrote plist
View controller-based status bar appearance - NO
DOES NOT work
As in the apple manual:
@property(nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden;
- (void)setStatusBarHidden:(BOOL)hidden;
Doesn't work either.
Each controller has - Status Bar NONE
Already tried everything - zero.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
lubimow, 2013-09-27
@lubimow

I did it like this - everything works.
Set "View controller-based status bar appearance" to NO in your plist, then add this code:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
or
alternatively, you can leave "View controller-based status bar appearance" on, and in your view controllers, add this method:
- (BOOL) prefersStatusBarHidden {
return YES;
}

I
IgorFedorchuk, 2013-09-27
@IgorFedorchuk

Try this in the root controller

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

// Add this method
- (BOOL)prefersStatusBarHidden {
    return YES;
}

L
lubimow, 2013-09-27
@lubimow

Registered - now it gave out such crap
fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/lubimow/Library/Developer/Xcode/DerivedData/ModuleCache/3OQQ9G3BB8KEO/Darwin.pcm": file not found'
note: after modifying system headers, please delete the module cache at '/Users/lubimow/Library/Developer/Xcode/DerivedData/ModuleCache/3OQQ9G3BB8KEO'
1 error generated.

J
Jonh Doe, 2013-09-27
@CodeByZen

Well, delete the cache and see what happens.

L
lubimow, 2013-09-27
@lubimow

Sorry for the stupidity - but where to enter
- (BOOL) prefersStatusBarHidden {
return YES;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question