Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TableLayout Vs Recycler View?

I am developing an android app which will allow users to create polls. A user can create a question and provide a set of options.

I wanted to provide a feature in which users can add or remove options dynamically.

I can't decide which layout would be best.

TableLayout - Each row can contain an option. Vs RecyclerView - Each item can be an option.

(Note that each option actually would be an EditText View where the user has to enter the option content.)

I have seen people generally use the RecyclerView for very large data sets but for my use case, a user can add a maximum of 5 or 6 options. Apart from that, I'll be using a recycler view to collect the data. For such a use case, is it a good option to use the RecyclerView or something else?

Please provide suggestions

like image 322
Abhishek Gupta Avatar asked Feb 09 '17 15:02

Abhishek Gupta


2 Answers

Use RecyclerView even if your rows are such little (5 or 6). By doing that, you will facilitate navigation for user with just one screen.

like image 38
GB11 Avatar answered Sep 28 '22 06:09

GB11


Definitely RecyclerView.
With a RecyclerView you can easily add and remove items dynamically.

Use the TableLayout if you have a static amount of rows (TableRow), that you declare in XML.

like image 138
ElegyD Avatar answered Sep 28 '22 06:09

ElegyD