3
當在UITextField
上調用becomeFirstResponder()
時,光標從左上角開始動畫。我如何刪除它?刪除iOS中的UITextField光標動畫11
UITextField在一個SearchBar中。
當在UITextField
上調用becomeFirstResponder()
時,光標從左上角開始動畫。我如何刪除它?刪除iOS中的UITextField光標動畫11
UITextField在一個SearchBar中。
好吧,我解決了它在一個非常醜陋的修復。我會推薦一些其他的東西,但在谷歌搜索幾個小時後,我不知道如何。
我正在改變色調,等待1秒,然後再改回來。這足以刪除動畫。
// Hides the movement of the cursor in the text field
let originalSearchBarTintColor = textFieldInsideSearchBar?.tintColor
textFieldInsideSearchBar?.tintColor = UIColor.clear
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
textFieldInsideSearchBar?.tintColor = originalSearchBarTintColor
}
同樣,我不會推薦這個臨時修復作爲解決方案。