UIKeyboardAppearance broken: showing both styles at once - ios

I have a UITextView with the keyboard appearance set to dark. But once I present and then dismiss a UINavigationController I get a keyboard like this:
Now I'm not sure what to do to get this back to normal? Once I dismiss the keyboard and show it again it is back to normal, however this is not acceptable.
I'm assuming this is an Apple bug, but does anybody know a way to get around this?
Thanks!

Ok, I figured out how to get around this bug. You simply have to dismiss the keyboard before you present the view controller. Like so:
[self.textView resignFirstResponder];
I'm not sure what causes this bug, but just case anyone else is having this problem, that's what I'm doing to fix it.

Related

get viewControlelr appear event

When I touched the indication input, and click learn more, this will show from current viewController, however, when i touched the button "完成" which means done, the viewconteoller never go to the method as viewWillAppear or viewDidAppear, my viewController is landscape and this is potrait,so this cause the problem, I need go get the event when this page dismissed to fix the direction, anyone had good ideas to resolve this? Thanks
I resoled it with print all notifications, UIWindowDidBecomeKeyNotification can resolve my problem as this system page will use a new window to be keywindow, when it dismissed, the window of my viewController will be keywindow, i can use this to resolve my problem

Two taps required to make hidden UINavigationBar appear

I have a UITableViewController which contains cells of different languages. When the user taps a cell, they are taken to a UIPageViewController which shows the appropriate leaflet in that language. That part is working well.
I have implemented the use of the following code to make the UINavigationBar hidden and to appear on a tap:
self.navigationController.navigationBar.hidden = YES;
self.navigationController.hidesBarsOnTap = true;
I have that code in my viewDidLoad. I don't have any gesture recognisers, but both on the Simulator and on the device, to get the UINavigationBar to appear, I have to tap the screen twice. Why do I have to tap twice?
If I do the same on a UITableViewController, I only have to tap once, so it seems something specific about this UIPageViewController and I can't quite figure out what.
I've looked around and I can't seem to find anyone with anything similar.
On guidance on this would be appreciated.
Try this :
[self.navigationController setNavigationBarHidden:YES animated:YES];
If that does not work, can you post the code for your methods relevent to this issue?
Could probably help more with more info.

hide keyboard in secondary viewcontrollers when pressing background storyboard

I've been scourging the internet and saw several promising answers but none that worked for me. The problem I have is that I have many ViewControllers that I placed in Storyboard mode.
Lets say in my 5th view controller I have some TextViews and TextFields that pops up a keyboard for user input when pressed. However I want to be able to hide the keyboard when I press the background.
I tried following the first and second responses here: How to dismiss number pad keyboard by tapping anywhere
But I dont think my set up is exactly the same as theirs.
Can someone please help me? Please be VERY SPECIFIC if possible and dont assume I know how to fill in the dots.
Thanks so much!!
edit. sorry for not being clear but I meant I want the app to dismiss the keyboard when the user presses anywhere on the screen (thats not another Text field/view). The link I show does this but my problem is that I am storyboarding so I have multiple UIViewControllers and I'm not sure how to get IBOutlets/IBActions to work for the "secondary" viewcontrollers. They only show up under the first/main one...
In your application delegate file,
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self.window endEditing:YES];
}
you can use [self.view endEditing:YES];
have a look at the Apple docs for Ending a View Editing Session

UISplitViewController's detail view suddently stopped being pushed up when keyboard appears

Exactly what the title says. The problem is that at first it was behaving correctly, then I did something with rotation/orientation, and it started to behave this way:
https://www.youtube.com/watch?v=M4rcB8lzcpU
Now I restored the rotation thing and it still misbehaves. Question is: why?
You have to resize your DetailViewController scrollview, when keyboard appears. So that it will show you the textField appears to you. You have to add your resize code in textFieldBeginEditing: method and have to resize for old behaviour in textFieldEndEditing: method.

iPhone OS 3.2 (iPad) Modal View question

I am presenting a UIViewController as a modal viewcontroller with modalPresentationStyle = UIModalPresentationFormSheet. I have few UITextFields on its view.
My issue is that when I try to dismiss the keyboard ([textfieldname resignFirstResponder]), it doesn't do anything. However when I change the modalPresentationStyle to UIModalPresentationPageSheet, it works.
This seems to be a bug. Has any one faced similar problems and found a work around? Could I be doing anything dumb and silly?
I ran into this same issue with UITextView, I ended up subclassing UITextView and overriding resignFirstResponder as follows...
- (BOOL)resignFirstResponder{
[super resignFirstResponder];
// For some reason, UITextView doesn't like to give up first responder, ever....
return YES;
}
I haven't checked if this is still necessary in 4.3 but it was definitely needed in 3.2 in some cases.

Resources