Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xArtx

macrumors 6502a
Original poster
Mar 30, 2012
764
1
Hi Guys,
Is it possible for the App to remove the status bar when running on iPad,
when the App is not a Universal App (compiled only for iPhone) ?

Something tells me any iPad settings in a plist will be ignored for an iPhone App.

It's a very retro sprite game, where doing the iPad resolution wouldn't really have
any benefit, except perhaps this.
Cheers, Art.
 
Hi Guys,
Is it possible for the App to remove the status bar when running on iPad,
when the App is not a Universal App (compiled only for iPhone) ?

Something tells me any iPad settings in a plist will be ignored for an iPhone App.

It's a very retro sprite game, where doing the iPad resolution wouldn't really have
any benefit, except perhaps this.
Cheers, Art.


You use the idiom call to tell if your app is running as an iPad app or iPhone app. There are other calls that let you tell what kind of hardware you are running on. (Don't remember the details off the top of my head.)

You should be able to write code that figures out what device it's running on and then hides the status bar if it determines that it's running on an iPad, even though you are running as an iPhone app.
 
I can already see if it's an iPad
Code:
    NSString *deviceType = [UIDevice currentDevice].model;
    if([deviceType isEqualToString:@"iPhone"]) {} // it's an iPhone
    if([deviceType isEqualToString:@"iPad"]) {} // it's an iPad
(omitting other device types)...
The way I hide the status bar is in Xcode's interface for the project,
which I think is linked to the setting in the plist file,
but the iPad is ignoring that.
Is there a way to do it at run time?

edit,,
Code:
[[UIApplication sharedApplication] setStatusBarHidden:YES];
This could be the ticket.


You use the idiom call to tell if your app is running as an iPad app or iPhone app. There are other calls that let you tell what kind of hardware you are running on. (Don't remember the details off the top of my head.)

You should be able to write code that figures out what device it's running on and then hides the status bar if it determines that it's running on an iPad, even though you are running as an iPhone app.
 
I can already see if it's an iPad
Code:
    NSString *deviceType = [UIDevice currentDevice].model;
    if([deviceType isEqualToString:@"iPhone"]) {} // it's an iPhone
    if([deviceType isEqualToString:@"iPad"]) {} // it's an iPad
(omitting other device types)...
The way I hide the status bar is in Xcode's interface for the project,
which I think is linked to the setting in the plist file,
but the iPad is ignoring that.
Is there a way to do it at run time?

edit,,
Code:
[[UIApplication sharedApplication] setStatusBarHidden:YES];
This could be the ticket.


That or the UIApplication method setStatusBarHidden:withAnimation:
 
I can already see if it's an iPad
Code:
    NSString *deviceType = [UIDevice currentDevice].model;
    if([deviceType isEqualToString:@"iPhone"]) {} // it's an iPhone
    if([deviceType isEqualToString:@"iPad"]) {} // it's an iPad
(omitting other device types)...

I would recommend using something like this:
Code:
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
 
I would recommend using something like this:
Code:
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )

No, that tells you if you are running in iPad or iPhone mode.

In the OPs case of an iPhone app that's running in iPhone mode on an iPad, the idiom call will return UIUserInterfaceIdiomPhone, which is not what he wants.

His code that checks the device type is the correct answer in this case.
 
Only problem is it is only the iPhone that is listening to the programatic
way to turn the status bar off.
I went to put the line in ly app delegate, and it was already there.
 
I think they've thought beyond it, when an iPhone App is running on iPad,
the iPad is using the 3.5 inch screen, and even in 2x mode, they know there
is always room left for the iPad status bar.

Also, if you run an iPhone App that normally wants to show the status bar,
I wonder if they had to do any fiddling to handle where the status bar would
be shown on the iPhone screen within the iPad.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.