Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
テキストを含む textView があります。最後の 4 文字を削除して、さらにテキストを追加します。これをやってみました。
textViewObject.append("\b\b\b\b new text that I am adding");
しかし、バックスペースを行う \b の代わりに、テキストフィールドに小さな四角として表示されます。誰か助けてくれませんか?
最後の 4 文字を除くすべてのテキストを取得してから、新しいテキストを追加することで、同じ効果を得ることができるはずです。
String textViewText = textViewObject.getText().toString(); textViewObject.setText(textViewText.substring(0, textViewText.getLength() - 4) + " new text that I am adding");