Giusy Active Member Licensed User Feb 18, 2019 #1 Hi, I write this code: B4X: lbl.Initialize("Label") lbl.Text="AAAAAAAAAAA" & i lbl.Typeface= Typeface.DEFAULT_BOLD lbl.TextSize=20 lbl.SingleLine=True lbl.TextColor= Colors.RGB(0,0,128) lbl.Color=Colors.RGB(219,221,222) Which instruction should I use to center the text? Thank you
Hi, I write this code: B4X: lbl.Initialize("Label") lbl.Text="AAAAAAAAAAA" & i lbl.Typeface= Typeface.DEFAULT_BOLD lbl.TextSize=20 lbl.SingleLine=True lbl.TextColor= Colors.RGB(0,0,128) lbl.Color=Colors.RGB(219,221,222) Which instruction should I use to center the text? Thank you
BillMeyer Well-Known Member Licensed User Longtime User Feb 18, 2019 #2 Try this: B4X: lbl.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL) Have Fun !!! Upvote 0
Giusy Active Member Licensed User Feb 18, 2019 #3 Thank you very much @BillMeyer , it's perfect Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 18, 2019 #4 Cross platform solution: B4X: Dim x As B4XView = lbl x.SetTextAlignment("CENTER", "CENTER") Upvote 0