DataBinding: How to get resource by dynamic id?

前端 未结 6 1901
予麋鹿
予麋鹿 2020-12-24 02:12

I know that it is possible to reference resources in layout by their resource id:

android:text=\"@{@string/resourceName}\"

However, I would

6条回答
  •  离开以前
    2020-12-24 02:37

    As of June 2016 this is possible in XML:

    android:text= "@{String.format(@string/my_format_string, myPojo.resourceId)}"
    

提交回复
热议问题