Vin*_*ary 4 objective-c uikeyboard ios custom-keyboard
有没有办法检测键盘类型的变化与大小,类型和建议栏高度,从英语键盘改为包含某种建议栏的印地语(见截图).
普通英语键盘
第一个问题
改为印地语LIPI后 - 当我改变时,everthing很好,因为英语和印地语键盘的大小相同,但在开始输入后印地语Lipi建议覆盖TextField
第二个问题
更改为表情符号 - 表情符号键盘高度与英语相比稍微多一点,所以再次键盘覆盖了TextField.
添加一个名为"UIKeyboardWillChangeFrameNotification"的通知的观察者.
通知的"userInfo"字典在屏幕上具有多个键盘框架.
添加一个观察者
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logNotification:) name:UIKeyboardWillChangeFrameNotification object:nil];
Run Code Online (Sandbox Code Playgroud)
选择器与记录器
- (void)logNotification:(NSNotification *)notification {
NSLog(@"%@", notification);
}
Run Code Online (Sandbox Code Playgroud)
userInfo字典内容
userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = 0;
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 441.5}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 315}, {320, 253}}";
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
UIKeyboardIsLocalUserInfoKey = 1;
}}
Run Code Online (Sandbox Code Playgroud)