Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 UITextField 中禁用闪烁的光标?可能弄乱了 UITextInput 协议?谢谢你的帮助!
这是旧的,您找到了新的解决方案。但是有一个你可以使用的想法。我的东西光标是一个图像动画,所以你可以找到他们的看法。
运行思想的所有视图
for (id subview in myTextField.subviews) { if (is cursor view){ subview.hidden = TRUE; } }
也许这可以工作,但这是反复试验。
一种更简洁的方法是将色调颜色设置为清除,如下所示:
textField.tintColor = .clear