Android Data Binding using include tag

前端 未结 5 877
迷失自我
迷失自我 2020-11-28 04:11

Update note:

The above example works properly, because release 1.0-rc4 fixed the issue of needing the unnecessary variable.

5条回答
  •  没有蜡笔的小新
    2020-11-28 04:47

    An other interesting thing on this is that you can pas variables to the imported layout from the binder like this:

    MainBinding binding = MainBinding.inflate(getLayoutInflater());
    binding.buttons.setVariable(BR.varID, variable)
    

提交回复
热议问题