ios 11 中的密码自动填充快速输入栏
password autofill quicktype bar in ios 11
在 ios11 中引入了一项新功能:应用密码自动填充。
此功能允许用户直接从键盘快速输入栏使用他们在应用程序中保存的密码。
https://code.tutsplus.com/articles/faster-logins-with-password-autofill-in-ios-11--cms-29096
https://developer.apple.com/videos/play/wwdc2017/206/
但问题是当我使用 keyboardWillShow 或 keyboardWillHide 或 keyboardDidShow 或 keyboardDidHide 事件时 none 其中考虑了 keyboardSize 的快捷栏高度。
- (void)keyboardWillShow:(NSNotification *)notification {
NSDictionary* info = [notification userInfo];
CGSize keyboardSize = [info[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
}
keyboardSize 将是以前的 keyboardSize 所以如果我们有快捷栏现在它消失了它 keyboardSize 比它应该的更大,反之亦然。
似乎 keyboardWillShow 通知在快捷栏 show/hide.
之前触发
如果有人知道如何在快捷栏后触发键盘通知 show/hide 或任何其他建议,请分享。
谢谢..
我认为你用错了密钥
尝试UIKeyboardFrameEndUserInfoKey
Objective c
CGSize keyboardSize = [info[UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
Swift
let keyboardSize = (info[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
尝试使用UIKeyboardFrameEndUserInfoKey
不要UIKeyboardFrameBeginUserInfoKey
在 ios11 中引入了一项新功能:应用密码自动填充。 此功能允许用户直接从键盘快速输入栏使用他们在应用程序中保存的密码。
https://code.tutsplus.com/articles/faster-logins-with-password-autofill-in-ios-11--cms-29096
https://developer.apple.com/videos/play/wwdc2017/206/
但问题是当我使用 keyboardWillShow 或 keyboardWillHide 或 keyboardDidShow 或 keyboardDidHide 事件时 none 其中考虑了 keyboardSize 的快捷栏高度。
- (void)keyboardWillShow:(NSNotification *)notification {
NSDictionary* info = [notification userInfo];
CGSize keyboardSize = [info[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
}
keyboardSize 将是以前的 keyboardSize 所以如果我们有快捷栏现在它消失了它 keyboardSize 比它应该的更大,反之亦然。 似乎 keyboardWillShow 通知在快捷栏 show/hide.
之前触发如果有人知道如何在快捷栏后触发键盘通知 show/hide 或任何其他建议,请分享。
谢谢..
我认为你用错了密钥
尝试UIKeyboardFrameEndUserInfoKey
Objective c
CGSize keyboardSize = [info[UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
Swift
let keyboardSize = (info[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
尝试使用UIKeyboardFrameEndUserInfoKey
不要UIKeyboardFrameBeginUserInfoKey