简体   繁体   中英

Android data binding for TableLayout

I am reading this manual https://developer.android.com/topic/libraries/data-binding/index.html and it is not clear for me, how to fill the TableLayout with rows if my data is kept in ObservableArrayList? All examples assume there to show a single record, but I want to show all records in the table.
Or may be it is impossible and I should use RecyclerView instead?

You might find this article helpful:

https://medium.com/google-developers/android-data-binding-list-tricks-ef3d5630555e#.c1vesyobm

It discusses how to turn lists in to Views in a ViewGroup. When you make it work for TableView, you might want to publish it here for people to use.

That said, if you have only a few Views, you can use data binding. If you're planning on having a scrolling list, you should use RecyclerView.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM