I am using below code to get the keyboard location from view & add DONE button on it.But in ios 8 it is not able to get keyboard location & hence not add DONE butto
I did like "Alex-stone" but I can't to click custom button.
My solution:
//create DoneCustomReturnKeyButton to add into keyboard
- (void)addDoneCustomReturnKeyButtonInKeyboard:(NSNotification *)notification
{
NSArray *arr = [[[[UIApplication sharedApplication] windows] lastObject] subviews];
if (arr.count > 0) {
UIView *keyboardView = [arr objectAtIndex:0];
float height;
if ([[keyboardView description] hasPrefix:@"
}
and create button.
- (void)createDoneCustomReturnKeyButton
{
self.doneCustomReturnKeyButton = [UIButton buttonWithType:UIButtonTypeSystem];
[self.doneCustomReturnKeyButton setTitle:NSLocalizedString(@"NEXT", nil) forState:UIControlStateNormal];
[self.doneCustomReturnKeyButton.titleLabel setFont:[UIFont systemFontOfSize:20]];
self.doneCustomReturnKeyButton.adjustsImageWhenHighlighted = NO;
self.doneCustomReturnKeyButton.backgroundColor = [UIColor lightGrayColor];
[self.doneCustomReturnKeyButton setTintColor:[UIColor whiteColor]];
[self.doneCustomReturnKeyButton addTarget:self
action:@selector(doneCustomReturnKeyButtonAction:)
forControlEvents:UIControlEventTouchUpInside];
}