0

I'm trying to do a game using Android Studio. I have done a gridview that contains the players, but my problem is making a button to add new players. I know how to do it, but I want to do it as in the picture, I have found no way to do it.

Picture about the button I want looks like on my gridview

In that picture the button will be on the sixth player position but if instead of five players there were four the button would be on the fifth player position (and so on).

kit
  • 1,166
  • 5
  • 16
  • 23
fingerlabs team
  • 23
  • 1
  • 2
  • 6

1 Answers1

0

How can I remove a button or make it invisible in Android? This article should provide most of the answers. What you will have to do, is set the images for each player to the position you want them(I.E like the picture) and use image.setVisibility(view.visible) on click, and let your code behind determine which players are active, so have a counter for active players so you can make a switch statement that enables the correct player image to become active depending on how many players are active or which positions are availible.

Hopes this helps

Community
  • 1
  • 1
  • I've thinking on that just now, making two buttons and depending on the number or players make visible one or the other and alter them. – fingerlabs team Apr 01 '16 at 11:46