Android Question Get panel measured width

wimpie3

Well-Known Member
Licensed User
Longtime User
When I look at all Panel values in the tree debug mode, I can see the property "mMeasuredWidth". How can I access this property? I have tried the following:
B4X:
Dim jo As JavaObject=myPanel
log(jo.RunMethod("getMeasuredWidth", Null))

but it returns 0 (which is not the value shown in the debug tree explorer).
 

wimpie3

Well-Known Member
Licensed User
Longtime User
SOLVED. In case someone else sees this, the reason for the 0 was that the panel was not yet drawn. Add a DoEvents before the call and the correct number will be returned.
 
  • Like
Reactions: eps
Upvote 0
Top