I am trying to hide status bar for iphone application development.But when i am playing video at that that status bar come and after that when i come back to previous screen status bar showing . If i am not playing any video than whole application the status bar hiding.
Can you please help me to hide status bar on video screen ,even i tried for "[[UIApplication sharedApplication] setStatusBarHidden:YES];" before playing video .but this is not working.
"
Thanks,
KamalBhr
[[UIApplication sharedApplication] setStatusBarHidden:YES];//iOS3
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; //iOS4
is basically the way to go, but the important part is where respectively when to call it.
that depends a bit if you're developing for iOS4 or iPhone OS 3.0.
in iOS 3 is used to hide the status bar when the Notification MPMoviePlayerContentPreloadDidFinishNotification was fired.
in iOS4 i didn't have any problems hiding the bar before i set the ContentURL of my MPMoviePlayerViewController's moviePlayer property.
i hope i could help.
sam
Related
In my app, I load a HTML Page in Web View which contains a video. Till this the navigation bar is shown properly.
But when i play video with by default Movie Player in iphone & try to see it in Both Landscape/Portrait mode with Full Screen. When get Back from Movie Player, the Navigation Bar is go to upside & status Bar is Cover some view.
I am not taken mediaPlayer framework or any other class in my project.
How can i solved This issue??
Just paste this below line in to the viewWillAppear: on that view controller class where this issue occurs.
Objective C
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Swift
UIApplication.shared.setStatusBarHidden(false, with:UIStatusBarAnimation.none)
In your Movie player class replace
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
with
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Means if you hide your status bar when came back from player then the height of the view will increased by 20 pixels.
So your view will go upside
I am calling a youtube channel on a UIWebView. When user selects a video, device launches its video player as normal. However, when video ends or user finishes it returning to view, an offset is applied to whole app!! All views have an offset on top but this only happens on iPad and iPad simulator with compatibility mode, on iPhone and iPhone simulator not! How to solve it? Thank you.
Problem is that status bar dissapears after video execution.
[[UIApplication sharedApplication] setStatusBarHidden:NO]; problem is beeing solved when an event is fired using NSNotificationCenter
I'm using the KTPhotoBrowser library to create a photo gallery in my iPhone app. The gallery consists of a thumbnail view (KTThumbsViewController) and a scroll view (KTPhotoScrollViewController) which displays the full size photos like in the official iPhone photo app.
I've managed to get everything working fine but sometimes when navigating back to the thumbnail view from the photo scroll view the status bar disappears leaving a 20px black gap at the top of the screen where the status bar once was.
This has a serious knock on effect for the whole navigation stack as the views dimensions alter from being (320,416) to (320,436) resulting in everything shifting up 20px.
Has anyone else encountered this issue and if so have you been able to resolve it?
I have managed to come up with an interim solution which prevents the app from breaking.
In KTPhotoScrollViewController.m I have commented out the following code in the toggleChrome method:
/* if ([[UIApplication sharedApplication] respondsToSelector:#selector(setStatusBarHidden:withAnimation:)]) {
[[UIApplication sharedApplication] setStatusBarHidden:hide withAnimation:NO];
} else { // Deprecated in iOS 3.2+.
id sharedApp = [UIApplication sharedApplication]; // Get around deprecation warnings.
[sharedApp setStatusBarHidden:hide animated:NO];
} */
This means that the status bar never hides and as a result the issue of it disappearing when transitioning between views never occurs.
is it possible to remove the play button in the statusbar if I play an soundfile but the app is in backgroundmode and I see the springboard.
http://i.stack.imgur.com/qsxLl.png
regards Alex
we can not change the icon of the status bar . but we can hidden the status bar of the Application
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
try running the audio in ambient mode.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Hide the status while playing movie using MPMoviePlayerController
It seems that if you play a movie full screen the status bar is turned back on. You can hide it on movie load but as soon as you click the controls to come up it reappears. There seems to be no movie controls appear events.
Update:
This is only an issue if you tab the screen for the movie controls to come up. Its something to do with the movie control.
Otherwise you could:
Use this when you want it to show:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]];
Use this when you want to hide it:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]];