Button1.Left=10dip
Button1.Width=100dip
Button2.Left=110dip
Button2.Width=100dip
I think: Button2.Left=Button1.Left+Button1.Width=110dip
If I change: Button2.Left=102dip There will be no gap. Thank you very much!
Is there a better way?
Hi Erel, I've tested that thread,But it set padding only, not set the gap between button and button.
but,That is also I need.
Anyway,Thank you very much.
Please use File - Export as zip when uploading projects.
The problem is not with the padding. I was wrong ,the padding is not relevant here.
The buttons default drawable includes a small gap. If you replace it by replacing the background then there is no gap:
B4X:
Sub Activity_Create(FirstTime As Boolean)
For x = 0 To 10
For y = 0 To 10
Dim b As Button
b.Initialize("b")
b.Text = x & " " & y
b.Color = Colors.Blue
Activity.AddView(b, 40dip * x, 40dip * y, 40dip, 40dip)
Next
Next
End Sub