A
A
Anton Yeskin2014-02-18 09:44:18
Objective-C
Anton Yeskin, 2014-02-18 09:44:18

How to hide statusbar when showing UIActivityViewController in iOS7?

The question is specifically about iOS7 on the iPhone.
There is a view controller. It has a method declared:

-(BOOL)prefersStatusBarHidden
{
    return YES;
}

Accordingly, the statusbar is hidden.
I show UIActivityViewController from this controller:
- (IBAction)share:(id)sender {
    
    NSArray *activityItems = @[.....................................];
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
    [self presentViewController:activityViewController animated:YES completion:nil];
}

The UIActivityViewController is rendered and the statusbar is shown.
Is it possible (and how) to make the statusbar not be shown when the UIActivityViewController is displayed?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
S
s0L, 2014-02-18
@cramen

Try setting UIViewControllerBasedStatusBarAppearance to NO in the application's plist, but then the bar's status will no longer depend on controllers. If this option does not suit you, you can try to inherit UIActivityViewController and override prefersStatusBarHidden.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question