【发布时间】:2019-05-14 07:50:53
【问题描述】:
我在数据绑定方面遇到问题。在应用程序中,TextView 的默认值未显示。 TextView 只是空白。
XML 文件
<TextView
android:id="@+id/tvDoctorName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text='@{doctorsInfo.name , default="FetchingData"}'
android:textAppearance="@style/SuperHeadingText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
【问题讨论】:
-
您是否正在为
textatrribute 使用任何绑定适配器? -
不,我没有使用适配器..
-
在你的 Activity/Fragment 的任何地方,你是否以编程方式操纵这个
textView? -
不,我正在绑定 Api 响应。 (mBinding.setDoctorsInfo(data);)
-
你能试试 [stackoverflow.com/questions/34252516/… 告诉我结果吗。
标签: android