Currently i am updating a application to iOS 8. I am facing a new problem in Keyboard.
This keyboard hiding my textfield half. What i have to change for this?.
Currently i am updating a application to iOS 8. I am facing a new problem in Keyboard.
This keyboard hiding my textfield half. What i have to change for this?.
Ok, this worked for me.
First I binded a NSLayoutConstraint that already had.
__weak IBOutlet NSLayoutConstraint *bottomInputConstraint;
Then I subscribed to the keyboard's notification on viewDidLoad.
- (void)viewDidLoad{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
}
keyboardWillShow: method looks something like this:
- (void)keyboardWillShow:(NSNotification *)aNotification{
NSDictionary* keyboardInfo = [aNotification userInfo];
NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey];
CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue];
bottomInputConstraint.constant = keyboardFrameBeginRect.size.height + kBottomKeyboardMargin;
}