B4J Question [SOLVED] TextField Text Align

jcesar

Active Member
Licensed User
Longtime User
Hi

Its possible right align a textField text ? I think its better for numeric fields.

Thanks
 
Last edited:

jcesar

Active Member
Licensed User
Longtime User
B4X:
Sub SetTextAlignment(txt As TextField, Alignment As String) As Pane
    Dim jo1 = txt As JavaObject
    jo1.RunMethod("setAlignment", Array As Object(Alignment))
   
End Sub

B4X:
SetTextAlignment(txtValor,"CENTER_RIGHT")
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
B4X:
Sub SetTextAlignment(txt As TextField, Alignment As String) As Pane
    Dim jo1 = txt As JavaObject
    jo1.RunMethod("setAlignment", Array As Object(Alignment))
  
End Sub

B4X:
SetTextAlignment(txtValor,"CENTER_RIGHT")

i know this code works as i have aligned some nodes, but your statement is incomplete, it is missing the return part.
 
Upvote 0
Top