Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
iphone 的输入板上有一个“完成”按钮,但默认情况下没有任何操作。我可以添加一个动作吗?例如,按下“完成”时隐藏输入板?
在您的键盘委托中,您需要放弃焦点。例如
- (BOOL)textFieldShouldReturn:(UITextField *)aTextField { [aTextField resignFirstResponder]; return YES; }
这适用于完成键和返回键。