status bar becomes gradient after closing video in landscape mode
Asked Answered
A

1

2

Below is happening with iOS 6.

I am playing video which can be played in potrait or landscape mode. Once video's Done button is pressed I am making screen to potrait mode programmatically.

The problem is when I open app, I have black status bar.

When I play video as potrait only, I still see black status bar as shown below.

enter image description here

Now when I play video and shift rotation after after playback is done and click Done button, I make app in potrait mode. BUT now my status bar is changed to light black (maybe BlackTransculent).

enter image description here

Also if you see, I see something black left to the time.

Any idea what is going wrong? This is literally making me crazy.


Edit 1

Below is the code I am using.

In viewcontroller.m

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotate
{
    return NO;
}

In CustomNavigation.m

- (BOOL)shouldAutorotate
{
    return [self.visibleViewController shouldAutorotate];
}


- (NSUInteger)supportedInterfaceOrientations
{
    if (![[self.viewControllers lastObject] isKindOfClass:NSClassFromString(@"ViewController")])
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    else
    {
        return [self.topViewController supportedInterfaceOrientations];
    }
}

Note:

I am not using below code anymore.

[[UIDevice currentDevice] performSelector:NSSelectorFromString(@"setOrientation:") withObject:(id)UIInterfaceOrientationPortrait];

still this problem persist...

The problem is when I am in landscape mode and click done button.

Arana answered 26/1, 2014 at 13:46 Comment(11)
setOrientation: on UIDevice is not public but you probably already knew that.Subsocial
@DavidRönnqvist : what should I use then?Arana
@FahimParkar.. can u share your code?Runaway
@FahimParkar. Nothing seems wrong here. Can you upload your code in github? let me check it if I could help with somethingRunaway
@achievelimitless : I will create sample code tomorrow and upload in on github or dropbox... I will share link tomorrow once I am done...Arana
@FahimParkar.. sure. What happened to this question.. Is it working??Runaway
@achievelimitless : Nope.. I went ahead with custom alertview...Arana
@FahimParkar.. well then.. Feel free to accept answer .. ;)Runaway
@achievelimitless : After further investigation, I noticed that when MPMoviePlayerController is started, status bar is changing to transculent...Arana
@FahimParkar.. great.. n what about black dot?Runaway
that is the image that I have... I have image at position (0,-416,320,460)... What I did is when I go back, I am setting statusbar to black... it is just mpmovieplayer is setting statusbar to transculent... after stopping I am trying to set it to black, but its not working... not sure WHY...Arana
A
0

It's weird...

After further investigation, I noticed that when video is played in landscape mode, status bar is changed to transculent.

What I tried programmatically is after video is done with playing, set status bar back to black [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];, BUT that was not also working.

So what I did is when user hit back button, I set it to black and there it was working. Not sure what is the problem.

- (IBAction)takeMeBackAction:(id)sender {
    //    [self takeMeDownAction:nil];

    if (IS_DEVICE_RUNNING_IOS_6_OR_BELOW()) {
        [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];
    }
}
Arana answered 30/1, 2014 at 9:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.