Search code examples
iosobjective-cios9ios10ios-keyboard-extension

Custom Keyboard Height and add custom view over custom keyboard in ios


I am going to make a custom keyboard for my app and also implement custom keyboard extension for enhance my application feature at input level,
So i want add "custom view" over my custom keyboard in my app. when i am typing some word at that time add custom view over custom keyboard like gBoard, so how can add custom view and increase size of keyboard more then 216.


Solution

  • you should put this height constraint into viewWillAppear

     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];
    

    NOTE

    In iOS 8.0, you can adjust a custom keyboard’s height any time after its primary view initially draws on screen.