我使用DataBinding Api来设置android布局中的视图.这是我的布局.
layout.xml
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content"
android:text="@{ "Hello " + user.firstName}"/>
我希望TextView显示Hello UserName.如何使用数据绑定api实现此目的.
解决方法:
用严重的口音(`)来表示它
android:text="@{`Hello ` + user.firstName}"/>
标签:android,android-layout,data-binding,android-databinding
来源: https://codeday.me/bug/20191003/1850976.html