I am trying to update my iPhone app to iOS7.
I am having major issues with the navigation bar. I would like it to have the new navigation bar.
As you can see from my image it has squashed the title to the top near the status bar.
I dont want to remove the status bar.
Surely it cant be that difficult to change.
I also noticed on some apps its changed automatically and on other apps it hasn't?
Did you try to add:
self.edgesForExtendedLayout = UIRectEdgeNone;
in the viewDidLoad method?
You should try and do it the correct way by adding your view controller to a UINavigationController and use its UINavigationBar. This will handle most layout issues for you and will also be backwards compatible. If you post the code where you bring your ViewController on screen, we will gladly help to wrap it in a navigation controller.
Related
I am having an issue with UIImagePickerController. I'm presenting as Fullscreen. The issue is the images grid goes behind the navigation bar. I have even tried a new appearance proxy thing but no luck. Here is a link to the video of the issue.
UIImagePickerController issue
If anyone knows anything let me know, please.
I ran into the same issue recently(with iOS13).
The issue to me was resolved by setting UIScrollViewContentInsetAdjustmentAutomatic to [UIScrollView appearance] before present the image picker. Fyi.
if (#available(iOS 11.0, *)) {
[[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentAutomatic];
}
As there is code which set UIScrollViewContentInsetAdjustmentNever in my project.
Remember resetting the value to be UIScrollViewContentInsetAdjustmentNever after the image picker finished its work.
As of iOS 7.0, all views automatically go behind navigation bars, toolbars and tab bars to provide what Apple calls "context" – having some idea of what's underneath the UI (albeit blurred out with a frosted glass effect) gives users an idea of what else is just off screen.
If this is getting in your way (and honestly it does get in the way surprisingly often) you can easily disable it for a given view controller by modifying its edgesForExtendedLayout property.
For example, if you don't want a view controller to go behind any bars, use this:
edgesForExtendedLayout = []
for your case you can use it like this:
yourvc.edgesForExtendedLayout = []
For your reference i am also attaching a link which also answers your question.
I'm trying to create an app with two tabs. When I get to the scene where I can choose between tabs, the first one (the one which is loaded automatically) is showing as desired. But, when I click the second tab, it goes behind the Navigation Bar. Both Controllers have the same configuration, as far as I know. I can't find the problem here.
If I swap the order of the tabs the issue is the same. It looks like that the problem is with the Tab Bar Controller.
What can I do to fix it? Thanks.
you can do
self.edgesForExtendedLayout = UIRectEdgeNone;
on your -ViewDidLoad Method of the 2nd view
How can a navigation bar be supported in both iOS 6 and iOS 7 with a UIContainerView via a storyboard?
I am updating an iOS 6 app to iOS 7, but want to continue to support iOS 6. I have a main top level view that is embedded within a UINavigationController. The view within the navigation controller has a container view in it. I am using a storyboard to lay out the view.
On iOS 7 the navigation controller uses the entire screen, and I've set it up to put the container view content below the navigation bar. In iOS 6 the content of the view does not go under the navigation bar, so I have a blank gap below the nav bar.
Normally I would just reset the origin of the offending view on iOS6 (in ViewDidLoad or somesuch) and go on my way. However since my content is in a UIContainerView, I can't seem to change the frame after it loads. (I have tried this in prepareForSegue: when loading the UIContainerView. I'm open to having done this wrong? heh)
The closest I have found is using the following code under iOS 7 to make the nav bar opaque and keep the content out from under it, then using the entire space for my UIContainerView.
// tell the view to not extend below this nav bar
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
This solution works but has the side effect of showing the status bar as black (since it's more or less "blank" under the status bar). Alternatively, if I put the top edge of the container view below the status bar, on iOS 6 I have a big gap below the navigation bar.
I can eliminate the use of a navigation controller, but that seems a bit heavy handed in this situation and I'd like to use that as a last resort.
I've found the solution to this.
You need to set the barTintColor in iOS 7, which also seems to color the main status bar, as well as setting the nav bar to not be transparent like this:
mainController.navigationBar.barTintColor = [SRPRTabletHelpers customUserColor];
mainController.navigationBar.translucent = NO;
The non-transparency was the key, while setting the color sets not only the regular nav bar, but the color beneath the status bar as well.
I also needed to change my containerView top edge to be the full height of my view contained within the navigation controller, now that it is not transparent, and it works the same on both iOS6 and iOS 7.
While you mention to have already solved this, your method seems to require a lot of manual code and if checks. The iOS 7 UI Transition guide, in the Supporting iOS 6 chapter mentions another way: first design your interface for iOS7 as you have done, with your view extending below the navigation bar.
Then, in the interface builder open the size inspector for UI elements and modify the iOS 6/7 deltas. These values are applied when the storyboard is not run on iOS 7. For example, in your case you can select all your visual elements, then set the Y delta to -44, which is the standard navigation height. That will make the UI go up on iOS6, compensating the fact that the view doesn't go under the navigation bar.
When I use a modal view controller in iOS7 it slides underneath the status bar. Is there a way to stop that from happening without having to adjust the view based on what os it's running on? You can see that the Close button is pushed up underneath the Carrier text on the status bar. Is there any way to get the modal view controller to recognize my status bar?
Have you seen this? UINavigationBar/Status Bar issue in IOS7
There are a couple of things you can try, but I think what you're looking for is here, in the iOS7 Transition Guide: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html
I'm using the new Storyboarding feature in Xcode 4.2, and I've run into a problem where my UITableView seems to forget that there is a Navigation Bar upon device rotation. When the device is rotated, the cells appear to be trapped under the Navigation Bar. This bug is driving me absolutely insane, where I might just trash the project and start over.
Since I have recently noticed this, I am not sure if it is something that I had done / misconfigured or a bug. Nevertheless, to the issue:
Images of the Issue:
The image below shows what my application looks like once loaded. Everything is aligned correctly
Once the device is rotated, the UITableView ignores the Navigation Bar and assumes its space.
The problem persists even when the device is reoriented to portrait mode.
My struts and springs in Xcode are no different from a default UINavigationController dragged out from the object library. I've even ditched my UINavigationController and reconfigured a new one.
For the record, I do NOT have my main navigation controller subclassed.
Lastly, there is a similar post on Stack Overflow, but as you can see, my Navigation Bar does resize itself correctly upon rotation.
Add this in the didRotateFromInterfaceOrientation method.
[self.navigationController.view layoutSubviews];
Looks like you have wantsFullScreenLayout = YES in the UIViewController.