G giada Member Jan 28, 2021 #1 i need to add by code a label on a B4XPAges... i found this code B4X: Copy Dim ButtonX As Button ButtonX.Initialize("Button") ButtonX.Tag = PosX Activity.AddView(ButtonX,x*33%x,y*20%y,33%x,20%y) What is the correspong code of Activity.AddView(... for B4XPAges? thanks
i need to add by code a label on a B4XPAges... i found this code B4X: Copy Dim ButtonX As Button ButtonX.Initialize("Button") ButtonX.Tag = PosX Activity.AddView(ButtonX,x*33%x,y*20%y,33%x,20%y) What is the correspong code of Activity.AddView(... for B4XPAges? thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2021 #2 Root.AddView. While you can use percentage, it is less recommended as it is not cross platform. You can use 0.33 * Root.Width instead. Tips: - Do whatever you can with the designer. It will make things simpler, especially with cross platform projects. - If you want to create a label, you can use XUIViewsUtils.CreateLabel from XUI Views library. Upvote 0
Root.AddView. While you can use percentage, it is less recommended as it is not cross platform. You can use 0.33 * Root.Width instead. Tips: - Do whatever you can with the designer. It will make things simpler, especially with cross platform projects. - If you want to create a label, you can use XUIViewsUtils.CreateLabel from XUI Views library.