iphone - Avoiding scrolling when switching among text fields -


I have a visual controller for the view of six UITextFields. Whenever a user selects a text field, then I need to scroll upwards. Therefore the text fields set all the view controllers as their respective delegates. When the representative method sets fire, it tells a scrolling method to scroll things (if the keyboard is visible) or below (if it is disappearing). The scrolling method looks like this:

  - (zero) scroll: (CGFlot) distance up {[UIView Start Permissions: @ "Scroll" Reference: NULL]; // Move some things over the distance, or if the distance is negative [UIView commitAnimations]; }  

If the user selects a text field, then he enters the value, then hits the full button on the keyboard, it works fine.

The problem arises when users switch directly from one textfield directly to another, in that case, what happens that the scene jumps downward, then scrolls back, obviously I would like it to be just the place Stay in How can I do this?

As suggested by the commentator, what did I do field field representatives Instead of UIKeyboard notifications in ViewDidLoad, I have the following:

  [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Sylector (KeyboardValues) Name: UIKeyboardWillShowNotification Object: Zero]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (KeyboardWhalide) Name: UIKeyboardWillHideNotification Object: Zero];  

Keyboard Scrolling / Shipping Methods Scrolling is called Down / Down.

I unregistered both in viewDidUnload and dealloc. [And I'm not sure these two registries are necessary.]


Comments