AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
02/20/15 06:03 AM (9 years ago)

Hiding the status bar in ios?

I'm playing with admob interstitials and I find that the ios status bar (i.e. with the battery meter, signal strength icons etc) show up over the interstitial. The issue with that is the interstitial close button is sometimes on the right and partially obscured by the battery meter icon. I don't know if that would impress the app reviewer, (it doesn't impress me) so I was looking at how to hide the status bar, (or alternatively make the interstitial a bit smaller?). I'm not so worried about the rest of the buzztouch nav bar, as it does not interfere with the interstitial close. I have looked and found this post, which seemed the mose relevant: http://www.buzztouch.com/forum/thread.php?tid=8D69CC256E5AD7072F920B8&fid=BC70C36A743CD4FAD95D17F&sortColumn=FT.id&sortUpDown&currentPage=1 I edited the pList, as also suggested in stackoverflow: View controller-based status bar:NO Status bar is initially hidden: YES It does not seem to have any effect. I altered [self setStatusBarStyle:UIStatusBarStyleDefault] but that only affected the text in the status bar. What am I missing?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/20/15 06:25 AM (9 years ago)
To show [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; To hide [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; add the hide when the interstial is shown add the show again when it is dismissed
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/20/15 06:39 AM (9 years ago)
Thanks kittsy, I gave it a go. Here is how I used it: if ([self.interstitial isReady]) { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; [self.interstitial presentFromRootViewController:self]; THe interstitial shows, but sadly the statusbar is still there.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/20/15 06:41 AM (9 years ago)
boo, i'll have a look when I'm at my mac
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/20/15 06:49 AM (9 years ago)
much appreciated, cheers.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.