View creation / initialisation control object dimensions

This might be a pretty silly question, but at what point during a view’s creation can the dimensions of the controls be accurately ascertained?

Asking as I have a method, viewportWidth(), which just returns the width of the control (in this case an iOSCanvas subclass), e.g. Return self.Width

In the view layout, the width of this control is the full width of the ipad/iphone screen, but when running the app, the viewportWidth() method returns “100” a number of times, before returning the expected value (1024). Is there any flag or such that indicates when a view has been opened (and so values returned from control dimensions will be accurate)?

If I checked a control’s size directly from the View’s resized event, it still had the old values. I then called a timer from the View’s resized event that checked the control’s size. Using the timer returned the correct size values for the control.

The correct control size is also returned in a method called from within the resized event. This forum includes too many examples of timer-based solutions! :wink:

I was using the View’s resized event and not getting the updated control size values. If I had used the control’s resized event, the values would have been updated.