Removing space around buttons.

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Removing space around buttons.

Postby pocnib » Wed Feb 10, 2010 3:56 am

I currently have a grid of buttons, but am noticing that there is a gap between the placement of the buttons. I am using a TableLayout, but want to get rid of the gap so that each button is touching the buttons to its left, right, top, and bottom, like what you would get using a GridLayout in traditional Java. I tried setting the padding of the TableLayout, TableRow, and individual Buttons with setPadding(0,0,0,0);, but the gaps are still there. Is there anyway to remove these?

I am also looking at GridView as a possibility, but I cannot get it to work with just regular buttons with text, the example is only for ImageButtons
pocnib
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Feb 08, 2010 12:07 am

Top

Postby azraeal » Wed Feb 10, 2010 7:25 am

I haven't taken a look into the table layout, but from my html background, I'd suggest you look into the element margins and table cell spacings. Also, make sure your images don't have transparent borders to them, since they make the picture bigger than they appear.

As for the GridView example, just replace all mentions of ImageView with your own custom view. You'd need to change the ImageAdapter and define your own custom view(either through XML or code).
azraeal
Experienced Developer
Experienced Developer
 
Posts: 71
Joined: Fri Sep 04, 2009 6:34 pm
Location: California

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests