B4J Question problem with the final size of a label

LordZenzo

Well-Known Member
Licensed User
Longtime User
when I add a Label or a TextField from code I am not sure of its size
the cause is the resize of the same in height based on the Font size
is there a solution to this? using prefHeigth does not make sense and the value of Heigth is zero until the form is displayed and therefore useless when "creating" the form
 

William Lancee

Well-Known Member
Licensed User
Longtime User
You can fix the size of a label with a CSS style. Use the CSSUtils library.

B4X:
    CSSUtils.SetStyleProperty(lbl, "-fx-max-height", 50)
    CSSUtils.SetStyleProperty(lbl, "-fx-min-height", 50)
 
Upvote 0

LordZenzo

Well-Known Member
Licensed User
Longtime User
You can fix the size of a label with a CSS style. Use the CSSUtils library.

B4X:
    CSSUtils.SetStyleProperty(lbl, "-fx-max-height", 50)
    CSSUtils.SetStyleProperty(lbl, "-fx-min-height", 50)
provato e funziona ?
 
Last edited:
Upvote 0
Top