Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TableLayout vs GridView vs Other?

I am developing an app and am looking for some general guidance:

The app is a memory trainer, and will have a couple of different modes:

  • Numbers: Up to 400 digits will be displayed on the screen in a gridlike pattern
  • Faces: Images of faces will appear, approximately 9 to a page, also in a grid pattern

The question is: can I accomplish this with a single xml layout file, and should I use the same layout type for each (and if so, what should it be!) ? It's a large app, so consistency would be heavenly.

I would prefer a layout with flexibility, and I am leaning toward GridView right now.

Any thoughts?

like image 564
Rob Avatar asked Dec 02 '22 01:12

Rob


1 Answers

A Grid view is basically like a list view where items are arranged in a static grid. It retrieves views from the Adapters as scrolled by user.

A table layout is a layout manager and does not do scrolling if required.this means u have to put it inside a scroll view. This implies that all of the data you are displaying must be populated into the TableLayout up-front, so the ScrollView knows the total space it is to scroll in. It also does not directly give you per-"item" selection or interaction, because a TableLayout doesn't have items, it is just a layout manager.

Also Adapter -based view should be used where significant amount of data is there to be scrolled. So it seems that grid view would be more suitable in the situation u r working.

like image 189
Shaireen Avatar answered Dec 04 '22 01:12

Shaireen