Kotlin Extension Functions Databinding

后端 未结 3 1318
独厮守ぢ
独厮守ぢ 2021-02-06 21:36

Is there any possibility to use extension function with a databinding? XML:


    

        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-06 21:55

    While @skiff2011 is correct, one could also use alias to prevent the Kt postfix.

    For example, a certain extension function is located in ExtensionFunctionsKt can be aliased by ExtensionFunctions

    
    
    
    

    The ExtensionFunction alias can now be used to call the extension function. The first argument still needs to be the extended class variable.

    
    

提交回复
热议问题