Unable to change UIInputView height

前端 未结 4 2059
北荒
北荒 2021-02-14 08:55

I have a simple UIInputViewController subclass with only two overridden methods. I use this input view controller as inputAccessoryViewController on my UIViewContro

4条回答
  •  长情又很酷
    2021-02-14 09:29

    I don't know if this is the issue, but the problem may come from the 0.0 multiplier you are setting on _heightConstraint. Try to change it to 1.0.

    It would look like this:

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

    Hope this helps!

提交回复
热议问题