objc// Presented when object becomes first responder. If set to nil, reverts to following responder chain. If
// set while first responder, will not take effect until reloadInputViews is called.
@property (readwrite, retain) UIView *inputView;
@property (readwrite, retain) UIView *inputAccessoryView;
为了答好楼主的题目我自己写了个测试,请看效果图


实现原理在这里, command + shit + O 输入 UITextField.h 在第94行
我这里用了
UILabel,理论上只要是UIView类都可以self.nameField.inputAccessoryView = _dingdingLabel;
你想表达什么,不知所云
之前需要这种类似的东西,我采用的办法就是定义一个view加上textfield和button。
然后根据键盘事件来判断这个view的出现和上移,但是我觉得这种不是那么合理。
提供一个思路希望对你有帮助。
在键盘上是可以添加一个控件叫uitoolbar的,我以前写过在uitoolbar上添加按钮,我刚刚查了一些uitoolbar也是可以添加自定义view的。可以尝试一下uitoolbar。