rkb
rkb

Reputation: 11231

How to remove a white bar from the top in iPhone

I have a UITabBarController in my application. In the first view of this controller I have a UINavigatioController and user can navigate to multiple views through this NavigationController. In the rootview of this controller I have my frontview or main view of the application which have an info icon, which flips the screen to info page which is an another view in my appDelegate. So I use the following code from my appdelegate to switch to info page.

UIView * controllersView = [aboutUsViewController view];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[self.window addSubview:controllersView];
//[aboutUsViewController animateView];
[self.tabBarController.view removeFromSuperview];
[UIView commitAnimations];

My problem is when I flip, I see a very small white bar at the top. This white bar is seen only while fliping from main view that is first screen to info page and not viceversa.

I am confused how to remove this bar since I have a UIImage covering my whole page on the mainview.

How to solve this.

Upvotes: 6

Views: 2619

Answers (7)

S.Yadav
S.Yadav

Reputation: 4509

If you are working on ionic2 then here is the code-

let config = {statusbarPadding: false};
ionicBootstrap(MyApp, null, config);

This worked for me! Here it is in more details-
ionic2 how to remove white space from status bar from top in iphone

Upvotes: 0

me1974
me1974

Reputation: 99

I had the same puzzle/riddle/problem: after switching back from a modal view the underlying view had a light blue status bar, which showed for half a second:

enter image description here

However, because I did take this screenshot, I realized it's not the status bar, but some distant remainder of the navigation bar. I switched navigation bar off in the app delegate, but here it still, and only during the transition (after the UIModalTransitionStyleFlipHorizontal transition there was no blue bar)

Therefore what I did was giving it a translucent color:

self.title = @"";
self.navigationController.navigationBar.tintColor = [UIColor clearColor];

Might not be the world's finest solution, but it's not a bug with Apple.

Upvotes: 0

gburgoon
gburgoon

Reputation: 601

You probably shouldn't be doing all those animations yourself. I'm not exactly sure what your goal is, but it might be easier to use something called "pushModalViewController" and have a controller for your info page, along with a view. This may fix the problem, because it may just be something to do with animations.

Then, when you exit your info page, control returns to your navigation controller (which is what I think you want). I hope this helps.

Upvotes: 0

Mike W
Mike W

Reputation: 4428

I'm not sure if you are displaying the status bar or not, but you may want to check if your UIImage size completely goes to the top of your view - especially if you've added it in IB. Also, try setting the cache setting in your transition to NO to see if that makes a difference. It uses more resources, but I've had to do that to stop text fields from blanking out during a transition.

Upvotes: 0

mahboudz
mahboudz

Reputation: 39376

If the bar is only visible during a transition, then change the color of your main window to be the same as the view you are transitioning. Or you can make it totally translucent, which may do the same.

Upvotes: 2

Frank Schmitt
Frank Schmitt

Reputation: 25775

Have you tried setting wantsFullScreenLayout on your view controller?

Upvotes: 0

casademora
casademora

Reputation: 69667

I had the same problem. I think this is a bug in the 3.1 OS. File a bug with Apple. My current workaround was to use the standard slide up modal transition. Not the best solution, but at least it doesn't look weird.

Upvotes: 0

Related Questions