I developed an iOS app based on a tab bar at the bottom of the screen. The tab bar is supposed to have an OPAQUE white background, however with the latest iOS update the appearance gets sometimes altered..
After clicking on the “more” tab and selecting any of the tabs displayed in the vertical list, the view that appears next has a TRANSPARENT rather than a WHITE OPAQUE tab bar background! Forcing the tab to a specific color in the AppDelegate.m and setting alpha to 1 does not solve the issue. It still shows as transparent.
self.tabBarController.tabBar.barTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1.000];
It is very frustrating seeing old code that was working perfectly well breaking for no good reasons with subsequent iOS updates..
Related
I am having some graphical issues adapting my app to ios7. All my icons (color icons) now seem worse. They are completelly blue or grey depending where they are set.
Ok, I can assume that. But now, I have some problems with UISegmentedControl. they show a blue thiny line all around and I want to hide it. Just showing the image icon.
Is it possible?
The preview window/multitasking switcher shows a weird behaviour in iOS 7.
Here is how it appears when I set this property for both apps.
self.navigationController.navigationBar.translucent = NO;
Now for the white app I commented the line.
Now when I run it again and go directly to the switcher, this is what I get:
If I run the app and then go to the home screen or any other app and then go to the switcher, this is what I get:
Is there any way to correct this problem while having translucent navbar?
Thanks.
I ran into this as well. Since you don't have any content under the translucent navigation bar (and/or tab bar or tool bar), it can sometimes appear black in the app switcher. I was using a collection view that was constrained to the top and bottom layout guides and so there was nothing behind the tab bar and navigation bar. When the app is in the foreground it looks correct because there must be some default background color applied by Apple (maybe on the UIWindow) so you don't see through to the springboard. This background color seems to be gone (or black) when in the app switcher causing it to look like that.
The problem goes away on view controllers that are set to extend under top and/or bottom bars:
self.edgesForExtendedLayout = UIRectEdgeTop | UIRectEdgeBottom;
or in Interface Builder:
If that doesn't fit you needs or you still have other view controllers that don't extend under top and bottom bars you will still get the black bars in the app switcher. The way I solved it was to set the UIWindow background color in my appDelegate.
self.window.backgroundColor = [UIColor whiteColor];
Instead of doing it in code, you can also do it via Storyboard.
In the navigation bar of your root navigation bar, make sure you turn off its translucency.
I reckon it's a simpler solution.
I am using a custom color for my UINavigationBars that I set globally (on iOS7) in didFinishLaunchingWithOptions:
[[UINavigationBar appearance] setBarTintColor: [UIColor mainThemeColor]];
This works fine, but in two of my screens I see something very odd. When the view appears, I see a dark glow move in from the right, and the color of the bar ends up to be darker than what I set it to. I tried setting the color in viewDidAppear et al, but the same thing happens.
I have no idea how this can happen, all my views and viewControllers are set up the same.
Also, when the app is in the background, and I go to the app switching view (with all the miniature screens), the bar for those two screens is completely dark, instead of the theme color.
Has anyone seen this?
EDIT: It has to do with calling self.edgesForExtendedLayout = UIRectEdgeNone; on my view controllers. If I remove that line, then the coloring of the navbar remains correct. However, in that case, part of my view is hidden.
Firstly, I'm French so; sorry for the english mistakes, I hope you'll understand my problem. I've only been working on iOS apps 3 months, maybe I havn't got all iOS development concepts.
I have an app correctly running on device and simulator using iOS 5 but when I try it on a iOS6 device or simulator I have a weird situation. A black bar appears at the top of the screen between the navigation bar and my tableview.
I did some research, others have the same problem but, what solved their problem didn't work for me.
See: Black bar between navigation bar and table view appears on iOS 6
I'm facing this problem since I upgraded my xcode version to 4.5 and the iOS6 SDK. See the following screenshots of the simulator, firstly running iOS6 then iOS5. The weird thing is that the black bar is here just after the application is launched. If I changed tab (obviously viewcontrollers are switched) then the black bar is no longer present.
I try to change the first viewController by switching the element of my tabBar but the same situation appears even if I put the tab called "Tendances" in first. The black bar is on this view but not on the others.
I have made these screenshots on the iphone 3 simulator but using iphone4 or 5 simulator or a real device didn't resolve my issue.
Screenshot 1: I launch the application on a iOS6 simulator. You may see that the black bar is betwen the navigation bar and the tableView header.
Screenshot 2: I'm still running the same app on the same simulation (iOS6), I decided to switch tab, using the tabBarController. The black bar disappear.
Screenshot 3: I go back to the first tab then there is no black bar...
Screenshot 4: I closed the simulator running iOS6 for another running iOS5. I launched the app then as you may seen there is no black bar.
I had the exact same problem: when first launching the app / this tableviewcontroller (mine is a fetchedresultscontroller, just to be more clear), the navigation bar would shrink in height and a black bar would appear in between the navigation bar and the viewcontroller's items. If I switched to a different view controller (not a tableview one) and came back, the bar would be gone and the nav bar back to its normal size. I have spent my last 3 hours looking for answers and just trying everything out there but nothing worked for me.
What did work in my case is a pretty weird solution: making the navigation bar invisible and then visible once again. So it seems like this actually loads it twice, first time being with the black bar and the second one, back to normal.
In my viewDidLoad I have this now:
[self.navigationController setNavigationBarHidden:YES];
[self.navigationController setNavigationBarHidden:NO];
Try this solution: How to set the top position = 0 after setStatusBarHidden:Yes?
I had once had the same issue, struggled through a lot of SO pages but this was the ultimate solution.
I'm having this issue with several screens in my app, but I'll explain what happens to my home screen. Hopefully the solution isn't as complicated as I'm thinking it will be. So my home screen has a logo at the top, a label(title) under that, 3 horizontal buttons under that, and finally, settings and info buttons in the bottom left and right hand corner respectively when if portrait orientation. In order to allow for landscape orientation, resizing masks were not able to achieve the look I wanted so I implemented the
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
method with an if and else statement, the "if" uses CGRectMakes to draw all of the elements where they should go in landscape layout, and the "else" redraws them back to their original places when changed back to portrait landscape. This all works very nicely. I remembered that we had to be able to handle the double high status bar, so I simulated it to see what it would do to my app. When I am on the home screen and toggle it on and off, the autoresizing of the items(which are set to adjust according to the top of the view) work nicely, by slightly squishing everything down a bit, and not hiding anything. I can toggle it off and on with no problems.
Now here's the problem:
When I have the double high status bar toggled on while on a different screen, then go back to my home screen, the resizing doesn't happen, and it redraws my screen full size according to the coordinates and sizes I have in the method I mentioned earlier, so the settings and info button are drawn halfway off the bottom of the screen. Same happens when switching from landscape back to portrait on the homescreen with the double high status bar already on.
Similarly, I have a map between a nav and tab bar on another page. When already on the page, and toggling it on and off, everything resizes nicely(the frame of the map changes height and the nav bar moves down). But again, I have a problem when switching to that screen from a different screen or from the landscape orientation, because instead of autoresizing appropriately, the map view and nav bar get pushed down behind the tab bar partially, obscuring the google trademark which is grounds for app rejection.
Sorry for the longwindedness, but I wanted to clearly describe what circumstances cause this problem. Any ideas would be greatly appreciated as I don't really have any idea how to approach this.
I've been trying to track down this problem myself. I think this happens because the autoresizing mask is only used when views are resized, and not when a new view is added to the scene.
For me, I wanted a settings view loaded from a nib and added on top of everything else. If the double-height bar was in effect when the view was added it would run off the bottom of the screen. To fix it you have to set the size and position of the view yourself when you load it. This is the code behind my working 'goto settings' button:
- (IBAction) settingsPressed:(id)_sender
{
NSArray* a = [[NSBundle mainBundle] loadNibNamed:#"SettingsView" owner:self options:nil];
SettingsView* settings = [a objectAtIndex:0];
settings.frame = self.view.bounds;
[[self view] addSubview:settings];
}
The important line being:
settings.frame = self.view.bounds;
Which, it would appear, classifies as a 'resize' and so the resizing-mask rules apply. I later added animations for the transition and it continues to work just fine.
Note: This method was in a View Controller.