小编Li.*_*Rui的帖子

UITextView.text 带有表情符号设置:cursorPosition 不正确

这里,str包含表情符号并且设置的光标位置不正确:

  let cursorPosition = str.characters.count
  let cursorRange = NSRange(location: cursorPosition, length: 0)
  textInputView.selectedRange = cursorRange
  textInputView.scrollRangeToVisible(cursorRange)
Run Code Online (Sandbox Code Playgroud)

uitextview ios emoji swift

2
推荐指数
1
解决办法
1255
查看次数

标签 统计

emoji ×1

ios ×1

swift ×1

uitextview ×1