iOSLabel Height always 100

  1. 6 weeks ago

    Hi everybody!

    I have a few labels on a view. In the Auto-Layout, I set their heights to different percentages of a iOSRectangle, for example, Height = recBackground.Height * 10% or 3% or 6%.

    During runtime I would like to read the absolute values of their heights but Xojo returns me .Height = 100 for all labels, although they clearly have different sizes on the view. Am I reading the wrong property?

    Thank you!
    Christoph

  2. I might add that Xojo returns .Width = 100 for all labels as well.

  3. Norman P

    Mar 12 Pre-Release Testers, Xojo Pro Enjoying Whistler BC

    when are you reading this ?
    that may be relevant

  4. Derk J

    Mar 12 Pre-Release Testers, Xojo Pro

    Tested to be 100.0000 (value indebugger) at all times so it seems. I think that Xojo doesn’t even set these or maybe used only in View.activate event? (If that one works)?

  5. Norman P

    Mar 12 Pre-Release Testers, Xojo Pro Enjoying Whistler BC
    Edited 6 weeks ago

    they may not reflect the actual frame or content sizes
    I dont recall that level of detail about the iOS C++ code and whether they do or not

    however it should be possible to read the frame and content sizes with a declare
    jeremey or jim m or one of the other folks who have posted a ton of declares for iOS may already have done this

    EDIT : it seems indeed Jeremy just posted about this https://forum.xojo.com/conversation/post/427411

  6. Norman P

    Mar 12 Pre-Release Testers, Xojo Pro Enjoying Whistler BC

    @Derk J Tested to be 100.0000 (value indebugger) at all times so it seems. I think that Xojo doesn’t even set these or maybe used only in View.activate event? (If that one works)?

    ah I wasnt clear
    when as in "in the open event" or some other event ?

  7. I am sorry Norman, I didn't see Jeremy's post when I searched for a solution. I only focused on height, not on width. I will try that.

    For the sake of completeness, I tried reading the height value on the view's Open and Activate event as well as the label's Open event. Same result every time.

  8. It works like a charm! Thank you all for your help.

or Sign Up to reply!