Android data binding is not working with attributes

前端 未结 2 1108
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 02:49

I\'m trying to use databinding with custom views (a possible usage George Mount showed here).

One can\'t imagine building compound views without <

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-09 03:33

    Actually you can use tag inside and do data binding.

    Ex:

    incl_button.xml

    
        
    
            

    fragment_example.xml

    
    
        
    
            
    
        
    
    

    ExampleFragment.kt

    binding.layoutBtn.btn.setOnClickListener{
       //...
    }
    

提交回复
热议问题