Mashiane Expert Licensed User Longtime User Jul 16, 2016 #1 This code below works for B4a. How can I have one to center a view on a page? Thanks B4X: Sub CenterViewOnActivity(p As Activity, v As View) v.left = (p.width-v.width)/2 End Sub
This code below works for B4a. How can I have one to center a view on a page? Thanks B4X: Sub CenterViewOnActivity(p As Activity, v As View) v.left = (p.width-v.width)/2 End Sub
Erel B4X founder Staff member Licensed User Longtime User Jul 16, 2016 #2 The best way is with the designer script: B4X: Button1.HorizontalCenter = 50%x Button1.VerticalCenter = 50%y Upvote 0
The best way is with the designer script: B4X: Button1.HorizontalCenter = 50%x Button1.VerticalCenter = 50%y
Mashiane Expert Licensed User Longtime User Jul 16, 2016 #3 Erel said: The best way is with the designer script: B4X: Button1.HorizontalCenter = 50%x Button1.VerticalCenter = 50%y Click to expand... Thanks Erel, youre the BOSS! Upvote 0
Erel said: The best way is with the designer script: B4X: Button1.HorizontalCenter = 50%x Button1.VerticalCenter = 50%y Click to expand... Thanks Erel, youre the BOSS!