问题
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