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 上 UIKeyboard 的用户输入?我想跟踪,如果用户在 firstResponder UITextField 为空时点击“退格”。我知道如何跟踪文本更改,但如果该字段为空,则单击“退格”时文本不会更改。
您可以将单个空格字符作为默认文本字段文本。如果它试图在您的 textshouldchange 委托中消失,则用户按退格键。您可以在实际使用文本结果之前删除前导空格。