mare1980k1 Member Licensed User Longtime User Nov 7, 2020 #1 Hi, I am declaring a label as such: B4X: Dim TextTrending As Label TextTrending.Initialize("TextTrending") TextTrending.Text = "Trending" TextTrending.Padding = Array As Int (0dip, 0dip, 0dip, 0dip) TextTrending.Gravity = Gravity.TOP I would like to align text to the top programmatically in the code, since the label isn't added with the designer, so I don't have that option in the designer. Do you know how to align the text without the designer? Thank you, Kind regards
Hi, I am declaring a label as such: B4X: Dim TextTrending As Label TextTrending.Initialize("TextTrending") TextTrending.Text = "Trending" TextTrending.Padding = Array As Int (0dip, 0dip, 0dip, 0dip) TextTrending.Gravity = Gravity.TOP I would like to align text to the top programmatically in the code, since the label isn't added with the designer, so I don't have that option in the designer. Do you know how to align the text without the designer? Thank you, Kind regards
Pendrush Well-Known Member Licensed User Longtime User Nov 7, 2020 #2 Something like this: B4X: lbl.Gravity = Bit.Or(Gravity.TOP, Gravity.CENTER_HORIZONTAL) Upvote 0