0

I have a bit of a weird scenario here and have been trying to find some help but the solutions don't really solve my problem rather make it worse.

I have a container viewController that has three child controllers views inside a horizontal scroll view. My default child controller view is my custom camera page. Now this is what I want to achieve. I would like to keep the status bar hidden on my camera page but would like the other two views aka my other two child controllers to have the status bar showing.

When I drag from either my left child controller to my camera page or from my right child controller to my camera page, I would like my camera page view to overlap the status bar.

The only place I have seen this done is on Snapchat and I've been trying for a couple hours to figure it out but just can't seem to come up with a solution. Any help is appreciated.

  • possible duplicate of [Hiding status bar iOS 7](http://stackoverflow.com/questions/18971496/hiding-status-bar-ios-7) – Michael Robinson Sep 09 '14 at 02:44
  • @MichaelRobinson No, my situation is different. I know how to hide a status bar from a viewController by just calling a simple method. I have overlap the status bar with my camera page VIEW since I have three child viewController views being managed by one content container viewController. – Vlad Bahtjak Sep 09 '14 at 02:47
  • Very interesting. Run Snapchat on an iPad - the area where the status bar should be bugs out when transitioning. – Max Chuquimia Sep 09 '14 at 02:53
  • Hmm yeah I noticed that @Jugal. Perhaps the camera page on the Snapchat has it's own unique window or something, i'm not sure but I'm quite interested in making the same effect. For now I just am using the scrollView delegates to hide and show the status bar depending on which page is visible. – Vlad Bahtjak Sep 09 '14 at 03:00
  • Actually, I think it's some sort of screenshot. The network activity indicator stops animating while you're partway through a transition, and the time won't change until you let go either :) – Max Chuquimia Sep 09 '14 at 03:03
  • Interesting, very interesting. I actually read about that a few hours ago on some website. – Vlad Bahtjak Sep 09 '14 at 03:14
  • Hmmmm That makes sense now. They are probably showing the status bar, taking a screenshot of that region and placing it on the view so that when you scroll to the camera it's an illusion looking like your overlapping the status bar! HAHA Those little rabbits, pretty smart. – Vlad Bahtjak Sep 09 '14 at 03:17
  • Yup yup - one more thing: attaching the device to a power source does update the battery icon – Max Chuquimia Sep 09 '14 at 03:51

1 Answers1

1

You can do it wizh the real Statusbar. Just get the Statusbars UIView you then need to play with the UIWindowLevel like this

    //Getting the Statusbar

    UIView *statusbar;
    NSString *key = @"statusBar";
    id object = [UIApplication sharedApplication];
    if ([object respondsToSelector:NSSelectorFromString(key)]) {
        statusbar = [object valueForKey:key];
    }

    //Set your Overlapping UIViewController or UIView one Level higher then the Statusbar.
    self.navigationController.view.window.windowLevel = UIWindowLevelStatusBar+1; //This will set the Overlapping UIViewControllers WindowLevel over the StatusBar.
David Gölzhäuser
  • 3,525
  • 8
  • 50
  • 98