android - Padding between dynamically created TableRows -


I have created a table layout and then I have dynamically created tables in my Java code, and in the form of an 8x8 Some buttons added. But I want to reduce the space between buttons. I tried to set the layout param for tableware, but when I do this, the output only shows a blank screen. Here is my code:

  layout at the ultimate = new layout paramax (layout parama.philpaint, layout para. WRAP_CONTENT); Area = New Button [8] [8]; TB = new table layout (this); Parametset margin (10, 2, 10, 2); (For int i = 0; i & lt; field.length; i ++) (table rolls current = new tablet (for this); for (int j = 0; j & lt; region [i] length; j ++) {button button = new button (this); field [i] [j] = button; button.setWidth (40); button.setHeight (40); button.setLayoutParams (ultimate); current.addView (button) ;} Tb.addView (current);} T.addView (TB);   

But when I do not write button.setLayoutParams (param) Get output:

Enter image details here

which Normal output is, except that I want the space between the buttons to be less.

The standard vacuum you see is the standard Android Button is a built-in padding in the background property, you can see that your layout is correct by turning on "Display Layout Bound" in Settings & gt; You just need to create your own button property, or if a simple color If all is needed, just set the button background to Color.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -