I am doing a project on gpsnote. if anyone have any information abt this application plz guide me…
I know this code bt i want textfield should come along with my keyboard
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
}
thanks
First set your content over a scroll view and set the scroll view in viewDidLoad:
then in viewWillAppear add following notification :
For keyboard shown
For keyboard hiding
Following are the two function which are called by the notifications
In keyboardWasShown function what we are doing is just getting the height of the keyboard and checking if the textField y axis (i.e textOrigin in the function) are greater than Y axis of keyboard than slide up the content of the scrollview which contain our text field.
NOw How to get the textfield Y axis. For this you have to use the textfield delegate, the following delegate will trigger when your textfield will become first responder
And finally in keyboardWillBeHidden we are reseting the scrollview contentview