Unable to change UIInputView height

前端 未结 4 2056
北荒
北荒 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:55

    I did it in Swift. hope this helps you.

    override func viewDidAppear(animated: Bool) {
    
        let heightConstraint = NSLayoutConstraint(
            item:self.view,
            attribute:NSLayoutAttribute.Height,
            relatedBy:NSLayoutRelation.Equal,
            toItem:nil,
            attribute:NSLayoutAttribute.NotAnAttribute,
            multiplier:0.0,
            constant:100)
    
        self.view.addConstraint(heightConstraint)
    }
    

提交回复
热议问题