加MDCTextInputControllerOutlinedT

加MDCTextInputControllerOutlinedT

本文介绍了如何增加MDCTextInputControllerOutlinedTextArea的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已从情节提要中为Uiview分配了一个名为 MDCMultilineTextField 的类.此类用于Multiline TextView.我的Uiview高度为400(不固定),但我的UiView边框与高度不同,请验证我的代码,您可以在下面看到屏幕截图.

I have assigned a class named MDCMultilineTextField for Uiview from the storyboard. This class is used for Multiline TextView. My Uiview height is 400(not fix) but my UiView border is not same as height, Please verify my code and you can see screenshot below.

        import MaterialComponents

        @IBOutlet var viewTextView: MDCMultilineTextField!
        @IBOutlet var btnDone: UIButton!
        var notes=""
        var dismissView: ((_ text:String) -> Void)?
        var desc: MDCTextInputControllerOutlinedTextArea?
       override func viewDidLoad()
        {
           desc = MDCTextInputControllerOutlinedTextArea(textInput: viewTextView)
           viewTextView.placeholder="Description"
           viewTextView.backgroundColor = UIColor.yellow
           if notes != ""
            {
                textView.text = notes
                viewTextView.text = notes
            }
    }

推荐答案

您可以将MDCMultilineTextField.layoutDelegate分配给UIView容器.它将根据MDCMultilineTextField高度更改容器大小.

You can assign MDCMultilineTextField.layoutDelegate to UIView container.It will change the container size based on MDCMultilineTextField height.

这篇关于如何增加MDCTextInputControllerOutlinedTextArea的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:05