Emme Developer Well-Known Member Licensed User Longtime User Sep 14, 2017 #1 Hi to all, i'm trying to do this stupid thing, but i don't find nothing. How to set label.gravity to vertical center and right? Thanks
Hi to all, i'm trying to do this stupid thing, but i don't find nothing. How to set label.gravity to vertical center and right? Thanks
S Scantech Well-Known Member Licensed User Longtime User Sep 14, 2017 #2 B4X: label1.Gravity = Gravity.CENTER_VERTICAL + Gravity.RIGHT Upvote 0
Emme Developer Well-Known Member Licensed User Longtime User Sep 14, 2017 #3 This sems to works, but i don't know why, i have a strange effect. If i add label in this way, works B4X: p.AddView(lbl,16dip,0,p.Width,-1) Works B4X: p.AddView(lbl,16dip,0,-1,-1) Doesn't work B4X: p.AddView(lb,16dip,0,p.Width-16dip,p.Height) I don't understand why it is related... Upvote 0
This sems to works, but i don't know why, i have a strange effect. If i add label in this way, works B4X: p.AddView(lbl,16dip,0,p.Width,-1) Works B4X: p.AddView(lbl,16dip,0,-1,-1) Doesn't work B4X: p.AddView(lb,16dip,0,p.Width-16dip,p.Height) I don't understand why it is related...
Erel B4X founder Staff member Licensed User Longtime User Sep 15, 2017 #4 You should use Bit.Or to combine gravities: B4X: label1.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.Right) It is possible that sum will also work with these values however it may fail in other cases. Upvote 0
You should use Bit.Or to combine gravities: B4X: label1.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.Right) It is possible that sum will also work with these values however it may fail in other cases.
Emme Developer Well-Known Member Licensed User Longtime User Sep 15, 2017 #5 Erel said: You should use Bit.Or to combine gravities: B4X: label1.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.Right) It is possible that sum will also work with these values however it may fail in other cases. Click to expand... I tried also it, but i have the same strange issue.. Upvote 0
Erel said: You should use Bit.Or to combine gravities: B4X: label1.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.Right) It is possible that sum will also work with these values however it may fail in other cases. Click to expand... I tried also it, but i have the same strange issue..
Emme Developer Well-Known Member Licensed User Longtime User Sep 16, 2017 #6 Solved using padding Upvote 0