Always Display Cursor UITextField

天大地大妈咪最大 提交于 2021-01-27 06:08:19

问题


I am trying to create a UITextField that will always display the blinking cursor whether the keyboard is displaying or not.

Is there any way I can achieve this effect?


回答1:


@andreamazz answer in Swift.

UITextField show cursor even when userInteractionEnabled is set to NO

UIView.animateWithDuration(1, delay: 0, options: .Repeat, animations: {() -> Void in
cursorView.alpha = 0 }, completion: {(animated: Bool) -> Void in
cursorView.alpha = 1
})


来源:https://stackoverflow.com/questions/39059625/always-display-cursor-uitextfield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!