iOS 10: UIImagePickerController type camera Status bar covers top content - uiimagepickercontroller

Using UIImagePickerController to capture the image, it is working fine on iOS9 but on iOS10 status bar covers the top content of controller.

I faced the same issue in iOS 10.
It looks like Apple is hiding the status bar automatically when the UIImagePickerController is presented, but for that you must have UIViewControllerBasedStatusBarAppearance set with YES in your info.plist file.
If you must keep UIViewControllerBasedStatusBarAppearance with NO, you should hide the status bar by calling:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
And then set it back when UIImagePickerController is dismissed.

Related

Xamarin.Forms iOS shows "Master" and "Detail" instead of just back icon or menu icon

on Android, my app shows a little arrow in the navigation bar up top that, once clicked on, brings you back one screen. But iOS, ofc is special, shows the word "DETAL" and "MASTER".
The do the same (open the menu, go back) but its wierd.
THis is how I open the page:
button_test.Clicked += delegate
{
Application.Current.MainPage = new Screen_MainMenu();
};
Can someone tell me, what is going on and how to just make it show the arrow and not the words?
Find the code where you set the icon on Page.IconImageSource , you have to ensure the image(back icon) already exists under the resource folder or image assets in iOS project .

Why is ADBannerView showing navigation bar on top, in iOS 6 only

I have an iOS application, with iAd using ADBannerView. It works perfectly in iOS 5, showing the ad full screen when the user taps on the banner. But when I run the exact same code in iOS 6, the navigation bar and tab bar shows on top of the ad:
Note that the "X" button on the Ad behind the nav bar works as it should to close the Ad, and the navigation bar and tab bar buttons work as well.
My app has a UITabBarController as the root controller, with 4 UINavigationControllers under it. And I did call this in didFinishLaunchingWithOptions:
[self.window setRootViewController:tabBarController];
What could be wrong? I'm guessing the view hierarchy is somehow not setup correctly.
Thanks in advance for your help!
I think I found the issue. This is most likely because my UIViewController hierarchy was not properly setup, in that I didn't have a addChildViewController: call where it's needed. The When to use addChildViewController vs pushViewController thread was very helpful.
An alternative that I'd recommend now is to simply use the code in the TabbedBanner project in the Apple iAdSuite sample.

Storyboard UINavigation Controller Back Button Text

In XCode 4.5.1 creating a storyboard app with a Navigation controller, I am having a hard time trying to set the BACK button for any view controllers that are pushed. I'm using segue's and the view controller shows as expected. However I want to change the name of the navigation bar and back button dynamically and placed this in my ViewWillAppear:
self.title = #"Select Songs";
[self.backButton setTitle:#"Add"];
changes the title of the navigation bar but the back button still displays the NAME of the pushed window rather than the text "Add".
The Simulated Metrics are all Inferred. I also added a BarButtonItem to the black tray below the view in Xcode and wired up the backButton of the viewcontroller to the backButton, yet the text still does not appear.
Adding the following log messages also yield something interesting: (and yet the titlebar is updating correctly)
-(void) viewDidAppear:(BOOL)animated {
NSLog(#"%s %#", __FUNCTION__, self.navigationItem.backBarButtonItem);
NSLog(#"%s %#", __FUNCTION__, self.navigationController.navigationItem.backBarButtonItem);
}
2012-10-14 15:18:41.835 xxxx[2690:907] -[ViewController viewDidAppear:] (null)
2012-10-14 15:18:41.838 xxxx[2690:907] -[ViewController viewDidAppear:] (null)
The accepted answer is a hack, this is the way to do it...
Open StoryBoard
In Document Outline window find ViewController to which you want to
return to
Click on Navigation Item of that ViewController
In Attributes explorer change Back Button value to your custom tile
That is it, enjoy...
The back button will show the title of the previous view and if no title is set it'll show 'Back'.
So in your prepareForSegue method, you can change the title of the current view before the next view is pushed. The back button will then show whatever you set the title to.

Switch back from view to tab bar view

I am trying to learn how to work with Xcode 4.5.
I have created a tab bar and would like to switch from one of the tab bar views (profile) to another view (settings -not within the tab bar menu), and back. I use below code to go to the:
- (IBAction)goToProfile:(id)sender {
ProfileViewController * profile = [[ProfileViewController alloc] initWithNibName:nil bundle:nil];
[self presentViewController:profile animated:YES completion:nil];
It works fine to go to settings, but when I go back from settings view to Profile, the tab bar menu is gone. How can i go back to profile view and see the tab bar again?
I had the same problem. You can either fix it with some code or you can just make some changes in your storyboard.
If you Put a Navigation Controller between your Tab Bar Controller and the View of your selected Tab (Profile in your case). If you use a push segue to go to the next View it will take the Tabbar to the next view and also a "Back" Button. (Settings in your case)
Here's an example of my App my jubla3ForthViewController would be your ProfileViewController and one of my jubla3PDFOnlineViewControllers would be your SettingsViewController.
http://www.abload.de/image.php?img=bildschirmfoto2013-01x2kti.png
(im not allowed to post direct images because of my low reputation points)
I hope this was usefull. If it was don't forget to push the up Arrow.

UINavigationController Layout Broken after Presenting Modal

Ever since iOS5, I have a problem where when I present and then dismiss a modal view, my Navigation Controller bar is hidden underneath the status bar. I have read the forums and tried many things but I cannot find the fix for this behavior.
Also, I get this behavior when presenting any modal view controller so it does not appear to be specific to the view controller I am presenting. At first I thought it was a problem with ZXing but this seems to be generic with the iOS5 update.
Additionally, if I select a UITextField after dismissing the modal and my navigation bar is hidden under the status bar, the keyboard comes up misplaced in my window. Again, if I do a rotate back and forth, the navigation controller bar and the keyboard work just fine.
Any ideas would be appreciated.
RESOLVED
OK. I finally found the problem here. Again this only appeared in iOS5 but when my RootViewController launches it holds off on rotations until the animation is done. Once it is done, then it allows rotations again. The problem was that it was returning NO for all aspects (including portrait). The view showed fine but when I would present a modal and return, the view geometry was mangled. Once I changed it to return YES for portrait mode even during animation, the problem went away.
RESOLVED OK. I finally found the problem here. Again this only appeared in iOS5 but when my RootViewController launches it holds off on rotations until the animation is done. Once it is done, then it allows rotations again. The problem was that it was returning NO for all aspects (including portrait). The view showed fine but when I would present a modal and return, the view geometry was mangled. Once I changed it to return YES for portrait mode even during animation, the problem went away.

Resources