Android data-binding (similar to WPF)?

后端 未结 8 2070
情话喂你
情话喂你 2020-12-13 12:56

I have searched for some similar questions before posting - however I have a general question when it comes to Android and data binding (and the other answers I check did no

8条回答
  •  悲哀的现实
    2020-12-13 13:57

    Native Data Binding

    Google has launched its native Data Binding Library!

    https://developer.android.com/tools/data-binding/guide.html

    Which lets you write your views as such

    
    

    But its event wiring mechanism at this time (rc1 version) can't bind to methods on a class extending from Observable (an exception is thrown when compiling; this is a known bug which will be solved).

    And sure the lack of two-way binding (which is not expected to be on the first release) is a big drawback.

    Anyway, here's a good sample project to play around with https://github.com/saleeh93/data-binding-samples

提交回复
热议问题