1.添加监听事件:
[[NSNotificationCenter defaultCenter]addObserver:self
selector:@selector(addDoneButtonToNumPadKeyboard)
name:UIKeyboardDidShowNotification
object:nil];
2.实现方法:
- (void)addDoneButtonToNumPadKeyboard
{
UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
if ([[[[UIDevice currentDevice] systemVersion] substringToIndex:1] intValue] < 8.0)
{
doneButton.frame = CGRectMake(0, 163, 106, 53);
}
else
{
doneButton.frame = CGRectMake(0, ScreenHeight-53, 106, 53);
}
don