(IOS)键盘上方增加工具栏

UIToolbar*keyboardDoneButtonView = [[UIToolbaralloc]init];

[keyboardDoneButtonView sizeToFit];

UIBarButtonItem*doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"

                                                               style:UIBarButtonItemStyleBordered target:self

                                                              action:@selector(doneClicked:)];

[keyboardDoneButtonView setItems:[NSArray arrayWithObjects:doneButton,nil]];

txtField.inputAccessoryView = keyboardDoneButtonView;

你可能感兴趣的:((IOS)键盘上方增加工具栏)