B4J Question [SOLVED] How to use padding with B4XFloatTextField?

LGS

Member
Licensed User
Longtime User
Hello everyone.
in B4A I use padding like this

B4A:
Private txtPassword As B4XFloatTextField
    Dim et As EditText = txtPassword.TextField
    et.Padding = Array As Int (5dip, 0dip, 30dip, 0dip)
    txtPassword.Update

I need to use paddin in B4J
Any suggestion?

Thanks in advance
 

MarcoRome

Expert
Licensed User
Longtime User
B4X:
B4XFloatTextField1.TextField.As(EditText).Padding = Array As Int (0dip, 0dip, 60dip, 0dip)

Add: Sorry, B4J havent EditText like in B4A. Ignore my answer
 
Last edited:
Upvote 0

LGS

Member
Licensed User
Longtime User
Hello Mr. MarcoRome
Thanks for the suggestion
Now I get the following error (image)

Code:
txtPassword.TextField.As(EditText).Padding = Array As Int (0dip, 0dip, 60dip, 0dip)
 

Attachments

  • Error.PNG
    Error.PNG
    5.2 KB · Views: 100
Upvote 0

LGS

Member
Licensed User
Longtime User
I tried it, but it has no effect

CCS:
-fx-padding: 15 0 0 30;
and
CCS:
-fx-padding: 15px 0px 0px 30px;
 

Attachments

  • Error2.PNG
    Error2.PNG
    2.4 KB · Views: 114
  • Padding.zip
    2.9 KB · Views: 83
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
?
Use CSSUtils
B4X:
    #If B4A
    SearchText.TextField.As(EditText).Padding = Array As Int (0dip, 0dip, 60dip, 0dip)
    #Else
    CSSUtils.SetStyleProperty(SearchText.TextField.As(TextField), "-fx-padding", "0 60 0 0")
    #End If

1636287428006.png
 
Upvote 0

LGS

Member
Licensed User
Longtime User
Thank you very much for the contribution @oparra
This works perfect for me

Thankful for everyone's time and support
 
Upvote 0
Top