iOS 13 UIImagePickerController Image/Video grid goes behind navigation bar - objective-c

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.

Related

iOS7 Navigation Bar Glitch On App Open and Close

I've noticed some interesting behavior with an app in iOS7. The navbar normally has the following color:
On all real devices, when the app is backgrounded or opened up, the navbar is temporarily covered with a black almost gradient mask that looks like this:
In the simulator, when the app is open and is backgrounded, I get the same black mask over it but the black is slightly shorter from top to bottom, but when it is opened up again I get the following weird white streak:
This is all temporary, and once the app finishes launching it goes away. Does anyone know what would cause this to happen?
I finally tracked down the issue to the following code in a table view controller I had:
if( IS_OS_7_OR_LATER ){
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;
}
The weird thing is, I've used this a million times to make the tableView properly sit under the navigation bar rather than just under it, so normally without this code it doesn't work right on iOS7 - but for some reason it does now. I'll have to look more into that... For some reason removing it from all my tableviews fixes the problem, but removing it from my regular view controllers fixes the navbar color problem, but makes the view's sit under the nav bar again.
I solved this issue by making sure I checked "Under Top Bars" in storyboard on the View Controller's attributes.

iOS 7 multitasking switcher: Navbar appears black

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.

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

ios 7 navigation bar too small

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.

UITableView Misalignment with Navigation Bar (cells get stuck underneath on rotate)

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.