Everytime I display a new Page, I call a routine that does this:
What is happening is that the first time the above is called, the button is aligned on the left. The second time, it moves to the right about 100px. The third time it goes back to the left. It keeps alternating like that.
Neither the b.CustomLabel.ALIGNMENT_LEFT or the SetLayoutAnimated seem to have any effect.
B4X:
Dim lbHamburger As BarButton = CreateFABarIcon(Chr(0xF0C9),"Left")
inParent.ToolbarButtons.Add(lbHamburger)
Public Sub CreateFABarIcon(text As String, tag As Object) As BarButton
Dim bb As BarButton
Dim b As Button
b.InitializeCustom("BarButton", Colors.White, Colors.RGB(16,116,74))
b.CustomLabel.Font = Font.CreateFontAwesome(32)
b.CustomLabel.TextAlignment = b.CustomLabel.ALIGNMENT_LEFT
b.Text = text
b.Tag = tag
b.SetLayoutAnimated(0, 1, 0, 0, 24, 24)
bb.InitializeCustom(b)
Return bb
End Sub
What is happening is that the first time the above is called, the button is aligned on the left. The second time, it moves to the right about 100px. The third time it goes back to the left. It keeps alternating like that.
Neither the b.CustomLabel.ALIGNMENT_LEFT or the SetLayoutAnimated seem to have any effect.