TableLayout Vs Recycler View?
Asked Answered
A

2

11

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

Aubrette answered 9/2, 2017 at 15:25 Comment(1)
I would say Recyclerview sounds perfect for your needs. easier than programmatically manipulating layoutsMismanage
G
7

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.

Gq answered 9/2, 2017 at 15:30 Comment(0)
S
1

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.

Seaquake answered 9/2, 2017 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.