Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 257

CF4rings
Code is Art
Profile
Posts: 6
Reg: Feb 14, 2013
Coatza
5,310
02/17/13 02:40 PM (12 years ago)

Android - Menu Buttons in Grid, how to center?

So i have this screen with 4 rows of 2 buttons each, Im using the Menu Buttons screen with the arrangement option "Grid". The problem is that the icons arent centered, they are in the right side of the screen. As if I where using the option "Vertical Right". I had to change the size of the images to 200 and put a margin of 40 to make them "centered". As you can imagine this is not a correct way to center buttons and a prove of that is that this method only works for my screen size haha (Samsung Galaxy S2), I check the app in a smaller screen and you can guess the result... Is there some way to correctly center an image or in this case a row of 2 buttons? I´ve tried editing screen_menubuttons.xml and BT_screen_menuButtons.java without having good results.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
02/17/13 03:21 PM (12 years ago)
Hi, in the button size, try playing with the margin and size value. Miguel
 
CF4rings
Code is Art
Profile
Posts: 6
Reg: Feb 14, 2013
Coatza
5,310
like
02/17/13 03:32 PM (12 years ago)
Mad thank for the reply, thats exactly what I did, change the size of the button to 200 and the margin to 40 and now the 2 buttons in the row are "centered" but this only applies to some devices.. the ones that have the same screen size as mine, I tried the app in a smaller screen device and the buttons arent centered there, in fact they look horrible there lol. Any other suggestion?
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
02/17/13 03:35 PM (12 years ago)
You can probably set it in the code, but thats to much for me. Someone will around and help for sure. I'm an IOS man, so it's easier. Android's problem is exactly that, you have too many different screens sizes and resolutions... Cheers. Miguel
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
02/17/13 11:16 PM (12 years ago)
I think you can change by percentage. If so, set the margins for 25% and the buttons at 50%, for example.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.