Vinx911 / FillBlankTextView

基于TextView实现填空文本控件
Apache License 2.0
0 stars 1 forks source link

EditText 位置偏移 #1

Open actor20170211030627 opened 2 months ago

actor20170211030627 commented 2 months ago

当我先输入一个短的文本, 然后重置输入内容:

//重置内容
viewBinding.fillBlankTextView.editText.setText("")
viewBinding.fillBlankTextView.text = "I have a ${get_(correctWord)}."

private fun get_(english: String): String {
    if (english.length <= 4) return "____"
    sb.setLength(0)
    for (i in 0 until english.length) {
        sb.append("_")
    }
    return sb.toString()
}

而重置后的内容长度比较长, 就会出现输入EditText位置偏移的情况: image

Vinx911 commented 2 months ago

能否给一个完整的测试例子