GridView, GridLayout or TableLayout?

I need to create several screens similar to this one:

enter image description here

In addition, if the user wants to show more buttons on the screen, it will be something like this:

enter image description here

Today I use LinearLayouts for this.

I would like to know which option is best developed as shown above.

  • The user does not have to jump up or down to see the rest of the buttons, the rest of the buttons will be displayed using the navigation buttons (do not worry, I will use Viewflipper for this)

  • The buttons should use the entire screen and have the same size. They need to resize if the images are large to fit the screen size

  • lungs. Low memory consumption

  • Buttons when pressed can open new grids

What is the best option for this? GridView, GridLayout or TableLayout?

Thank you in advance!

+4
source share
2 answers

GridView scrolls. it would be wise to use a GridView if you immediately load all the buttons and omit the previous and next buttons.

GridLayout is the way to go.

+3
source

Personally, I think the best way to do this is to create a relative layout in the code. Get the width and height of the screen. divide the width by 4 divide the height by 2 then call

RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(args to make fit screen and be in order); myRelativeLayout.addView(lp); 

and set the images in the order you want. to get spaces, use images that have alpha so that the edges make a gap.

then call

  invalidate() 

but it's just me. :)

check out some other places, such as How to lay out Views programmatically in RelativeLayout?

+2
source

All Articles