How to toggle a word selection view (change height) in iOS custom keyboard?

后端 未结 3 1797
故里飘歌
故里飘歌 2021-01-06 18:16

\"enter

I\'d to like to add a word selection view similar to the above in an iOS 8 cus

3条回答
  •  既然无缘
    2021-01-06 19:03

    It IS possible to change the size of the keyboard in the current iOS 8

    Taken verbatim from the documentation: "In iOS 8.0, you can adjust a custom keyboard’s height any time after its primary view initially draws on screen."

    To resize your custom keyboard, add a simple layout 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];
    

    For more information look at Apple's prerelease documentation here!

提交回复
热议问题