ios - 在 iOS 8 自定义键盘中显示建议栏

标签 ios ios8 xcode6

是否可以在自定义键盘中启用与附加快照中相同的建议栏。如果没有,那么我将不得不创建自定义栏,因此我将不得不增加键盘的高度。你有增加键盘高度的代码吗?

enter image description here

最佳答案

尝试:(viewDidAppearUIInputViewController 子类的方法)

- (void)viewDidAppear {
    [super viewDidAppear];

    CGFloat _expandedHeight = 250;
    NSLayoutConstraint *_heightConstraint = [NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:0.0 constant: _expandedHeight];
    [self.view addConstraint: _heightConstraint];
}

警告:写入viewDidAppear:方法

它不起作用。日志:

2014-10-01 17:10:38.532 Coloured[7232:308451] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x79829970 V:[UIInputView:0x79b2f660(250)]>",
    "<NSLayoutConstraint:0x79824ea0 'UIView-Encapsulated-Layout-Height' V:[UIInputView:0x79b2f660(216)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x79829970 V:[UIInputView:0x79b2f660(250)]>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

关于ios - 在 iOS 8 自定义键盘中显示建议栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26137432/

相关文章:

ios - 什么是动态框架而不是非动态框架?

ios - 在 XCode 问题中调试自定义方案

ios8 - 在 Xcode 6 和设备上运行测试

ios - 链接 Xcode 6/LLVM 6 的选择性库

ios - 选择单元格时 TableViewCell 内容重复

ios - UIDocumentInteractionController 需要很长时间才能显示选项

ios - 如何使用参数切换到 ViewController 或 TableViewController?

ios - Rx swift : How to use shareReplay to lazily get subscription

ios - 如何修复 Storyboard TextView 中的 UITextView

swift - 倒带时自动重新加载 TableViewController