Wish B4XView: HorizontalCenter and VerticalCenter

peacemaker

Expert
Licensed User
Longtime User
Why not to add into B4XView class 2 methods of the Visual Designer ?

B4X:
Sub setHorizontalCenter(v As B4XView, HorizontalPercent As Float)
    v.Left = v.Parent.Width / 100 * HorizontalPercent - (v.Width/2)
End Sub

Sub setVerticalCenter(v As B4XView, VerticalPercent As Float)
    v.Top = v.Parent.Height / 100 * VerticalPercent - (v.Height/2)
End Sub
 
Top