简体   繁体   English

UIInputViewController键盘未在iOS 8中显示

[英]UIInputViewController keyboard not displaying in iOS 8

I created custom keyboard. 我创建了自定义键盘。 but some times My keyboard is not displayed in my iOS8 iPhone5S 但有些时候我的键盘没有显示在我的iOS8 iPhone5S中

Please check the below code. 请检查以下代码。 I did anything wrong. 我做错了什么。

My code: 我的代码:

   // Perform custom UI setup here
self.nextKeyboardButton = [UIButton buttonWithType:UIButtonTypeSystem];

[self.nextKeyboardButton setTitle:NSLocalizedString(@"Next Keyboard", @"Title for 'Next Keyboard' button") forState:UIControlStateNormal];
[self.nextKeyboardButton sizeToFit];
self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = NO;

[self.nextKeyboardButton addTarget:self action:@selector(advanceToNextInputMode) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:self.nextKeyboardButton];

NSLayoutConstraint *nextKeyboardButtonLeftSideConstraint = [NSLayoutConstraint constraintWithItem:self.nextKeyboardButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.0];
NSLayoutConstraint *nextKeyboardButtonBottomConstraint = [NSLayoutConstraint constraintWithItem:self.nextKeyboardButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0];



UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
           action:@selector(aMethod:)
 forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(0.0, 0.0, 160.0, 160.0);
[self.view  addSubview:button];


[self.view addConstraints:@[nextKeyboardButtonLeftSideConstraint, nextKeyboardButtonBottomConstraint]];

Have you followed this steps? 你按照这个步骤了吗? because its working perfect for me. 因为它适合我。 more you can find here 你可以在这里找到更多

Use the toolbar to ensure that the active scheme specifies the containing app and an iOS Simulator device.

Choose Product > Run, or click the Play button at the upper left of the Xcode project window.
After the containing app and keyboard build and get installed in the simulator, you see the empty containing app running.

In iOS Simulator, choose Hardware > Home to view Springboard.
Go to Settings > General > Keyboard > Keyboards.
Tap Add New Keyboard.

In the Purchased Keyboards group, tap the name of your new keyboard. A modal view appears with a switch to enable your keyboard.

Tap the switch to enable your keyboard. A warning alert appears.
In the warning alert, tap Add Keyboard to finish enabling your new keyboard. Then tap Done.
Choose Hardware > Home to view Springboard.

In Springboard, pull down to reveal the Spotlight search field.

In the system keyboard, now onscreen, tap and hold the globe key to show the list of enabled keyboards. Then tap on the custom keyboard you just installed.

The same here ! 和这里一样 ! I concluded that it is a bug from iOS8 beta version .You can display the keyboard again by quiting the app in which the keyboard display , and restart the app then keyboard shows up normally. 我得出结论,这是iOS8测试版的一个错误。您可以通过退出键盘显示的应用程序再次显示键盘,然后重新启动应用程序,然后键盘正常显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS自定义键盘增加UIInputViewController高度 - iOS Custom keyboard increase UIInputViewController height iOS 9 UIInputViewController 关闭键盘 - iOS 9 UIInputViewController dismissKeyboard 无法在UIInputViewController中使用UICollectionView进行键盘扩展 - Can't use UICollectionView in UIInputViewController for keyboard extension 在UIInputViewController子类中检测旋转。 键盘扩展 - Detect rotation in UIInputViewController subclass. Keyboard extension 在不显示键盘的情况下获取 iOS 键盘的高度 - Get height of iOS keyboard without displaying keyboard iOS UIInputViewController:呈现自定义UIViewController + NIB - iOS UIInputViewController: present Custom UIViewController + NIB 解雇键盘后如何恢复UIInputViewController self.view? - How to restore UIInputViewController self.view after dismissing the keyboard? UIInputViewController(自定义键盘)-未触发UIButton操作-为什么,为什么? - UIInputViewController (Custom Keyboard) - UIButton action not being triggered - Why, Oh Why? 如何在UIInputViewController内使用UICollectionView进行自定义键盘扩展? - How to use a UICollectionView inside a UIInputViewController for a custom keyboard extension? 显示键盘时iOS App崩溃 - iOS App crash when displaying Keyboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM