Daestrum Expert Licensed User Longtime User Apr 23, 2018 #1 How do I get the width of a B4XView? I have tried .width but that returns -1 I have tried "getPrefWidth" that returns -1. Not sure what else to try to get the width. (the view was added in code not designer)
How do I get the width of a B4XView? I have tried .width but that returns -1 I have tried "getPrefWidth" that returns -1. Not sure what else to try to get the width. (the view was added in code not designer)
Erel B4X founder Staff member Licensed User Longtime User Apr 23, 2018 #2 Use the designer whenever you can. Everything will be simpler. -1 means that the width is not known. Upvote 0
Daestrum Expert Licensed User Longtime User Apr 23, 2018 #3 Sorted, it was the B4X: MainForm.RootPane.AddNode(??,??,??,-1,-1) that caused the problem, If I replace the -1's with the values I want it all works fine. But, I will bear in mind the comment about the designer. Upvote 0
Sorted, it was the B4X: MainForm.RootPane.AddNode(??,??,??,-1,-1) that caused the problem, If I replace the -1's with the values I want it all works fine. But, I will bear in mind the comment about the designer.