B4J Question [SOLVED] TextField Text Align

jcesar

Active Member
Licensed User
Hi

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

Thanks
 
Last edited:

jcesar

Active Member
Licensed 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")
 

Enrique Gonzalez R

Well-Known Member
Licensed 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.
 
Top