1

我正在尝试在我的快速项目中使用MDCTextFieldMDCTextInputControllerOutlinedMaterialComponents,但我面临着设计调整的重大挑战。它甚至不允许我更改文本字段的高度以及将文本输入部分居中。甚至占位符的字体都没有改变。尝试遵循 sdk 中提供的所有可能选项。

        tptf.placeholder = "Name"
        tptf.placeholderLabel.textColor = UIColor.green
        tptf.placeholderLabel.font = UIFont(name: "TimesNewRoman", size: 14)
        tptf.textColor = UIColor.green
        tptf.font = UIFont(name: "TimesNewRoman", size: 14)
        tptf.clearButtonMode = .unlessEditing
        tptf.delegate = self
        
        self.textController = MDCTextInputControllerOutlined(textInput: tptf)
        self.textController.textInsets(UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10))
        self.textController.activeColor = UIColor.green
        self.textController.floatingPlaceholderActiveColor = UIColor.green

PFA 图像在此处输入图像描述

4

0 回答 0