更新時間:2017-04-14 來源:黑馬程序員Android培訓學院 瀏覽量:
1 2 3 4 5 6 | android { .... dataBinding { enabled = true } } |
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 | <? xml version = "1.0" encoding = "utf-8" ?> < layout xmlns:android = "http://schemas.android.com/apk/res/android" > < data > < variable name = "user" type = "cn.itcast.mvvmdemo.User" /> </ data > < LinearLayout android:orientation = "vertical" android:layout_width = "match_parent" android:layout_height = "match_parent" > < TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "@{user.firstname}" /> < TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "@{user.lastname}" /> </ LinearLayout > </ layout > |