#android #android-edittext
#Android #android-edittext
Вопрос:
У меня есть EditText, и я вызываю EditText.getText().toString()
его при нажатии кнопки, но когда я распечатываю строку, несколько символов отсутствуют
Мой код:
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String result = editText.getText().toString();
Log.d(TAG, result);
}
});
XML:
<EditText
android:id="@ id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:background="@drawable/border_edit_text"
android:ems="10"
android:gravity="left"
android:inputType="textMultiLine"
android:isScrollContainer="true"
android:maxHeight="570dp"
android:paddingLeft="10dp"
android:paddingTop="20dp"
android:paddingRight="10dp"
android:paddingBottom="20dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@ id/speakTextBtn"
app:layout_constraintVertical_bias="0.016" />
Вот несколько его изображений:
Комментарии:
1. Удалите смещение обоих из них.
2. Что говорит режим отладки?
3. То же самое. Слова, в которых отсутствует несколько букв
Ответ №1:
android:autoLink="all"
android:ems="10"
Не могли бы вы удалить эти вышеупомянутые свойства и попробовать.
Комментарии:
1. Он по-прежнему заменяет несколько символов пробелом