У пользовательского интерфейса приложения сообщений, которое я кодирую, теперь есть проблема: сообщение предварительного просмотра имеет одну или несколько строк в интерфейсе.Тем не менее, строка может не быть целой строкой.А именно, одна строка сообщения может быть обрезана пробелом.Выглядит нехорошо.
Приложение написано на Android Java, а пользовательский интерфейс называется thread_row.xml.Я пробовал разные варианты Android: layout_height, но проблема все еще есть.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="threadRow"
type="com.samsung.ambsassistant.repository.ThreadRecord"
/>
</data>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_margin="5dp"
android:paddingBottom="10dp"
android:paddingStart="10dp"
android:paddingEnd="20dp"
android:paddingTop="10dp"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="10" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10" >
<TextView
android:id="@+id/participants"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="8"
android:text="@{threadRow.nomalizedOP}" />
<TextView
android:id="@+id/time_stamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:timeStamp="@{threadRow.timeStamp}"
/>
</LinearLayout>
<TextView
android:id="@+id/preview_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="@{threadRow.TEXT_CONTENT}" />
</LinearLayout>
</layout>
Ожидаемые результаты - целая строка в пользовательском интерфейсе, а не ее части.