首页 > 解决方案 > 更改 MDCTextField 轮廓文本字段的活动边框颜色

问题描述

我的文本字段

如何将 MDCTextField 轮廓的颜色从紫色更改为 .systemBlue?

标签: iosswiftmaterial-designmaterial-componentsmaterial-components-ios

解决方案


这是一个解决方案,对我有用

let textField = MDCOutlinedTextField(frame: .zero)

textField.setOutlineColor( .black, for: .editing)
textField.setOutlineColor( .red , for: .disabled)
textField.setOutlineColor( .red , for: .normal)

推荐阅读