View doesn't come back to normal position when 'little keyboard' button is clicked on the keyboard - iPad, Xcode - ios

I have a view with 2 text box's for id and password. When the user tries to enter fields, view will move up and the keyboard will pop up. After clicking 'NEXT' pointer moves to the second text box, and when DONE is clicked everything goes back to normal position. Everything is working perfect until here.
But what's happening is, when i click on the little keyboard icon in the very bottonm right of the keyboard, keyboard is disappearing but the view stays in the same position and doesn't animate down.
I have the code for animating based on the initial position of the view
//Condition to execute when the keyboard is initially clicked
if (_pagerView.frame.origin.y == _pagerFrame.origin.y)
//Condition to execute when the 'Done' Button is clicked
if (_pagerView.frame.origin.y != _pagerFrame.origin.y)
What i need is, the view to come down to normal position when the little keyboard is clicked.Thanks

Related

iOS keyboard prevent UIButton from reacting

I have 3 views illustrated as in the image. View 2 is in View 1, and View 3 is in View 2. Something weird is happening:
When I click the textfield in View 3, the keyboard opens, and at this time the button in View 2 no longer reacts. When I click button 2 with keyboard open, its color changes (notifies me it is clickable), but the event is never fired. If I don't click the textfield to open keyboard, button functions normally, color changes and the event is fired.
However, button 1 in View1 always works normally, doesn't get affected by the keyboard. It took me a while to find out it's the keyboard that makes the difference but I just can't figure out why. Could someone help me a little?

iOS 9 How to trigger an action after UINavigationController has resized after keyboard disappears

I have a UISplitViewController with a UINavigationController as the mater view. When the keyboard retracts, after closing an alert with a textfield, the animation seems to be the keyboard fully retracts, then the master view resizes as a visible two step process. The first image shows the keyboard hidden while the master view is resizing.
Screen shot showing resizing master view
I want to pop an action sheet automatically to prompt the user for the next step. I can wait for the UIKeyboardDidHide event, but the master view has not resized so the action sheet ends popping in the middle of the screen.
Screen shot showing floating action sheet
Is there a way to know when the animation is finished, so that I know when to pop the action sheet in the correct position?
Alternatively, is there a way to keep the master view from resizing to put the toolbar above the keyboard?

UIButton on left side of screen (in iOS 7 navigation slide area) not highlighted

I have a UIButton on the far left of a view controller (on a XIB), of say 100 points wide.
If the view controller is on a regular tab (i.e. not pushed on navigation stack) the button highlights as expected when tapped.
However, when the view controller is on a More-tab (so pushed on the navigation stack), the button is not highlighted when tapped on its left side (say the left most 50 points). The button does function, it's action is being called. But, when tapped on the right side it does highlight. (BTW, I think this is a general issue when the view controller is pushed from any other view controller; does probably not have to be More tab.)
After some research it turns out it's when I tap in the left screen area with which you can iOS-7-slide back to the parent view. Any ideas why this is, and how to make the button work properly again.
Thanks for your time!
I can confirm this bug with almost no code at all. All you need is an image file to serve as the background image. In the storyboard set this up:
Navigation Controller -> (root view controller) ViewController -> Button -> push segue... ->
ViewController2 -> Button
Put the second button up against the left side of its containing view (ViewController2's view) and set the image file as its highlighted background image.
Now run the app and tap the first button, to summon the second view controller's view. Tap the button at its right side: the highlighted background image appears. Now tap the button at its left side: the highlight background image does not appear, but the button is in fact receiving the tap (you can confirm that by giving it an action method that logs).
So, I would say you've got yourself a legitimate bug and you should report it to Apple. I'm certainly going to!
Unless you require the iOS 7 swipe-to-pop gesture, you can fix this bug by disabling that gesture recognizer:
self.navigationController.interactivePopGestureRecognizer.enabled = NO;

view resets when keyboard appears. ios 7

I'm writing an app where the controls provided can be hidden when required by the user to type text on the screen. the UI hides itself when the user taps the toolbar. but when he taps the text area all the changes made automatically undo themselves. the code just creates a textbox where the user taps and lets him type.
This is the first screen.
This is after the UI is hidden
And.. this is when the keyboard appears... the entire ui just pops up immediately.
Can anyone please tell my why this happens. and why my view resets everytime the keyboard shows.
Thanks.

ios app screen messed up when back button is hit

I have this scroll view problem.I have 2 screens in my app, Screen A and Screen B. I have 10 buttons on my first Screen A. They all are placed on a scroll view. I also have 2 UITextViews at the bottom right corner of the screen. When i click in the textivew to enter value it brings up the keyboard. Now without closing/hiding the keyboard i am clicking a button on my app.This takes me to a different screen, screen B. There i have a textfield and an add button. I click in the textfield and a keyboard shows up. I enter the value.Click the add button. It adds the entered value to a tableview i have on that screen.Now without closing/hiding the keypad on this screen as well i hit back button.So i am back in screen A. But now the screen is distorted. All fields are scrolled way up to the screen.There is a white space about 50-60% of screen at the bottom.
I followed this link http://www.techotopia.com/index.php/Writing_iOS_5_Code_to_Hide_the_iPhone_Keyboard
It worked in the morning for screen B.I hit back and it brought me to screen A and without any abnormal screen. Why is it happening?Doing the steps in that link will suffice? Or is it not that simple and i have to do somemore steps?Please help .Thanks..
EDIT: So i noticed a pattern.I enter value in UItextview.Click button on screen A, move to screen B .Add value here also .Click back then brought back to screen A and view is all messed up.
So i did this testing
1.Change UITextview value (keyboard pops up),just click button ->screen B.Do nothing on screen B.Hit back.Screen A is fine.
2.Hit button on screen A without changing anything on UItextview (no keypad pops up).Move to screen B.Do nothing here and hit back to screen A. Screen A appears and is perfect.
3.Hit button Screen A without changing anything on UITtextview (no keypad pops up).Move to screen B. Enter value in textfield. Click add button.Hit back.Come back to screen A. Screen A is fine.
4.Change value of TextView(Keypad pops up).Without hiding/closing this, hit button.Screen B appears.Enter value in textfield(keypad pops up).Click Add Button. Click back. Come back to screen A. Screen A is messed up.
In summary when i change values/ or when keypad appears in both screens screen A is messed up. Can someone help me out?
[self.view endEditing:YES]; does the trick. I added this in viewWillDisappear like this on both the screens.
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.view endEditing:YES];
}

Resources