PHPz2017-04-17 15:47:22
You should change your own layout, not someone else's keyboard height.
The rise to the philosophy of life is:
Change what you can change, accept what you can't change. :P
高洛峰2017-04-17 15:47:22
It’s basically fixed. Depending on the input method, the keyboard height will be slightly different. You can’t manually change the keyboard height unless you write a keyboard yourself
PHPz2017-04-17 15:47:22
The height of third-party keyboards can be adjusted, such as Sogou input method, Baidu input method, etc.
巴扎黑2017-04-17 15:47:22
You can create an attachment view - if you want to add a button, the keyboard height will not change
//Create an attachment view
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
//打开图片视图的可交互性
imageView.userInteractionEnabled = YES;
imageView.image = [UIImage imageNamed:@"inputImage"];
_passField.inputAccessoryView = imageView;
PHP中文网2017-04-17 15:47:22
First of all, the height of other people's keyboards cannot be changed, but it is not immutable. How should I put it? For example, the height of the system's default keyboard will change when you switch between Chinese and English, but this change is not controlled by your code. Instead, you have to adjust your UI according to its changes. For example, in the QQ chat interface, the input box always stays on the keyboard, so you have to layout it after the keyboard height changes.
The simple way is to receive the following notifications and perform the required corresponding operations
UIKIT_EXTERN NSString *const UIKeyboardWillShowNotification;
UIKIT_EXTERN NSString *const UIKeyboardDidShowNotification;
UIKIT_EXTERN NSString *const UIKeyboardWillHideNotification;
UIKIT_EXTERN NSString *const UIKeyboardDidHideNotification;
But this kind of wheel is already available, such as IQKeyboardManager
Then let’s talk about the custom keyboard (inputView)
The height can be changed, but the price is that you have to write a keyboard by hand, or refer to QQ’s keyboard for input emoticons, which should be customized.
Hope it helps you
Recommended part-time jobs for engineers, click on my avatar for details