I have situation on layout where are three panels (with imageview) and I would like to align them horizontally. First panel would be on the left, last on the right and second will be in the middle. Is there some math or trick how to arrange them?
Either in Layout Designer Script or in B4A code. Assuming panel sizes are already set (after loading layout) and you just want to align them horizontally with equal spacing, it'd be something like:
B4X:
Dim SpareSpace As Int = Panel1.Width - Panel2.Width - Panel3.Width - Panel4.Width 'big panel less three smaller panels
If SpareSpace < 0 Then Log("Houston, we have a problem")
Panel2.Left = 0
Panel3.Left = Panel2.Width + SpareSpace / 2
Panel4.Left = Panel1.Width - Panel4.Width