I have added a button to my page in Designer, it is marked as Style Custom, then in my code I am doing:
B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
btnCompany.CustomLabel.TextAlignment = btnCompany.CustomLabel.ALIGNMENT_LEFT
btnLocation.CustomLabel.TextAlignment = btnLocation.CustomLabel.ALIGNMENT_LEFT
End Sub
That gives a warning Object Converted to String This is probably a programming mistake and then displays the object information when run instead of the actual txt
That gives a warning Object Converted to String This is probably a programming mistake and then displays the object information when run instead of the actual txt
i am doing it allready like you suggest (via timer) but i think that it would be good for us to know why this code doesnot work and what is the right code.
maybe @Erel could bring some light to the darkness
It is always better to start a new thread for a new question.
You can use this code to set the button's alignment:
B4X:
'0 - center, 1 - left, 2 - right
Sub SetButtonAlignment(btn As Button, alignment As Int)
Dim no As NativeObject = btn
no.SetField("contentHorizontalAlignment", alignment)
End Sub
It is the same question as above (title)
Thatswhy i didnot start a new thread.
Just searched by my self for "button alignment - b4i" and this thread was in first place so i thought it would be good to have an answer to this thread...