2

My problem is write picture. I really need you help. Maybe inputAccessoryView, inputAccessoryViwController can be used, but I really have no idea. Thanks so much! enter image description here

Andrew
  • 15,357
  • 6
  • 66
  • 101
SamSam
  • 113
  • 8

1 Answers1

0

You can adjust the height of your custom keyboard’s primary view using Auto Layout. By default, a custom keyboard is sized to match the system keyboard, according to screen size and device orientation. A custom keyboard’s width is always set by the system to equal the current screen width. To adjust a custom keyboard’s height, change its primary view's height constraint.

The following code lines show how you might define and add such a constraint:

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

Source: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html

Add the code to viewDidAppear/viewWillAppear

Add your bar to the extra space. You can not make the background transparent.

zeiteisen
  • 7,078
  • 5
  • 50
  • 68
  • 1
    You may not believe it that the truth is not like what the documentation says. You can see this question on the StackOverflow : http://stackoverflow.com/questions/24167909/ios-8-custom-keyboard-changing-the-height Many people tried the method on the documentation, but it doesn't work. – SamSam Sep 27 '14 at 00:57
  • But SwiftKey obviously got it to work. What the hell did they do? Black magic? – jonathanpeppers Oct 21 '14 at 14:51
  • zeiteisen is right - add the constraints to ViewDidAppear/ViewWillAppear, not ViewDidLoad – HHHH Nov 29 '14 at 20:16