Android TableLayout vs GridView vs Other?

I am developing an application and looking for some general recommendations:

The application is a memory trainer and will have several different modes:

  • Numbers: Up to 400 numbers will be displayed on the screen in a grid.
  • Faces: faces are displayed, approximately 9 per page, also as a grid

Question: can I do this with one xml layout file, and should I use the same layout type for each (and if so, what should it be!)? This is a great application, so consistency would be heavenly.

I would prefer a layout with flexibility, and now I'm leaning towards GridView.

Any thoughts?

+4
source share
1 answer

The grid view is basically similar to the list view in which the elements are located in a static grid. It extracts views from adapters as scrollable by the user.

The table layout is a layout manager and does not require scrolling if necessary. This means you need to put it in the scroll. This means that all the data you display must be filled up in the TableLayout, so ScrollView knows how much space it should scroll. It also does not give you direct selection or interaction, because TableLayout has no elements, it is just a layout manager.

You should also use an adapter-based view where you need to scroll a significant amount of data. Thus, it seems that the appearance of the grid will be more appropriate in the situation when you are working.

+18
source

Source: https://habr.com/ru/post/1380323/


All Articles