I want to concat two strings for a TextView in android, Data Binding Api

前端 未结 10 773
太阳男子
太阳男子 2020-12-23 14:04

Im using DataBinding Api for setting the views in android layouts. Here is my layout.

layout.xml



        
10条回答
  •  礼貌的吻别
    2020-12-23 15:03

    concate it with grave accent (`)

    android:text="@{`Hello ` + user.firstName}"/>
    

    You can concat it in multiple ways, check it here concat-two-strings-in-textview-using-databinding

提交回复
热议问题