3

Enabling personal hot spot pushing down the view and related subviews pushing down. How to disable the personal hotspot notification programmatically? (how can i restrict iPhone status bar to original size even when HOT SPOT is on?)

KP26
  • 43
  • 1
  • 1
  • 8
  • This link will help you http://stackoverflow.com/questions/7759385/how-can-you-disable-the-ios-notification-center-within-your-app – Natarajan Mar 20 '14 at 12:29
  • Did you got a solution for this? Can we hide personal hotspot when our app is loaded? Please tell me if you got a solution @karthiik ps – Maul Oct 20 '14 at 11:45

4 Answers4

1

I found rather late that the Personal Hotspot doesn't just add 20points to the status bar, it messes up views that rely on drop points in an animator with gravity. I added code that checks the status bar height before laying out the views. If it's not 20, then it's probably the hotspot, so I just hide the status bar. Not an ideal solution, but works so far.

- (BOOL)prefersStatusBarHidden {
    if ([UIApplication sharedApplication].statusBarFrame.size.height == 20) {
        NSLog(@"Status bar is 20 so returning NO for hidden");
        return NO;
    }
    NSLog(@"Status bar is not 20 so returning YES for hidden");
    return YES;
}
budiDino
  • 13,044
  • 8
  • 95
  • 91
Mike Critchley
  • 1,643
  • 15
  • 20
0

If you disable statusbar then automatically disable Hotspot bar.

0

The Apple documentation is not very descriptive of the status bar, esp. the 2nd row that appears when you are using hotspot, map, calls, etc.

Even if more than one is running, there is only one additional row.

I don't know how 3rd party apps appear, but the questioner asked specifically about Personal Hotspot which is a system service.

I doubt the display can be controlled by anybody, except when the user turns the service off.

You probably have to do it the "hard" way". You should hide the main status bar, then draw your own custom status bar.

BTW, Apple says not to do this:

Use the system-provided status bar. People expect the status bar to be consistent systemwide. Don’t replace it with a custom status bar.

https://developer.apple.com/ios/human-interface-guidelines/bars/status-bars/

benc
  • 1,381
  • 5
  • 31
  • 39
0

It's an alternative way but it works. First include a new key in your project's Info.plist:

Status bar is initially hidden: YES

And then, in your AppDelegate, at didFinishLaunchingWithOptions you can set:

[application setStatusBarHidden:NO];

This will hide the hotspot bar during launch screen and then show it again when the app launches.

Luiz Dias
  • 1,947
  • 17
  • 22