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

前端 未结 10 830
太阳男子
太阳男子 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 14:55

    To do a concat in xml layout:

    
    
    /*This is used for android view*/
    
    
    /*This is used for android resources*/
    
    
    /*This is app context*/
    
    
    /*This is used for model data*/
    
    
    
    android:text="@{item.serialNo.concat(@string/space).concat(item.title)}"
    

    In strings.xml I have added code for blank space:

    \u0020
    

提交回复
热议问题