I added a label to the top of the keyboard in my app. I can explain how to add a subview to the keyboard.
First you need to register to receive keyboard notifications. I have the following in my app delegate:
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
Here is a snippet from my 'keyboardWillShow'. This allows you to get info about the size and location of the keyboard.
Code:
- (void)keyboardWillShow:(NSNotification *)note {
NSDictionary *info = [note userInfo];
NSValue *beginPoint = [info objectForKey:UIKeyboardCenterBeginUserInfoKey];
NSValue *endPoint = [info objectForKey:UIKeyboardCenterEndUserInfoKey];
NSValue *keyBounds = [info objectForKey:UIKeyboardBoundsUserInfoKey];
CGPoint pntBegin;
CGPoint pntEnd;
CGRect bndKey;
[beginPoint getValue:&pntBegin];
[endPoint getValue:&pntEnd];
[keyBounds getValue:&bndKey];
}
The next trick is actually finding the keyboard view. The keyboard view is actually in a second UIWindow separate from your app's main window. So you need to write code to walk all of the windows in the app. Then for each window you need to find the one that has a subview containing the keyboard. I do this by finding the subview whose description contains the string 'UIKeyboard'. I do this to avoid compiler warnings because the real class for the keyboard view isn't exposed via the SDK. But all you need is a UIView reference anyway.
Once you get the keyboard view, along with the coordinates you got earlier, you can now add a subview to the keyboard view.
I'm not going to give all the code because I worked very hard to figure this out on my own and it gives my app a little edge. Hopefully the info I gave will get you far enough to figure the details out.
Enjoy.