Height of Controls Inconsistent

I’ve noticed something odd with iOS TextFields and Segmented controls. They don’t have a consistent height. That is, on the screen (iPad or simulator) one can see two different heights. Note that in both controls the height is not settable with a constraint (it’s fixed). Also, sometimes the Priority is Medium and sometimes Highest.

Is this a bug? Is there a work around?

Which is a restriction that Xojo imposed, because iOS itself allows both those controls to be any size the developer desires.

There are few controls that are size constrained…

  • Activity Wheel (37x37)
  • Switch (51x31)
  • Stepper (94x29)
  • Progressbar (height=2)
  • as well as Navigation, Tabbar and toolbar

Dave,

But, any idea why they might appear in two different sizes? That is I have two text fields on the page, and one is taller than the other.

one of many reasons I don’t use Xojo for anything other than desktop apps…
but I would guess (just a guess) that it probably has something to to with the way Xojo attempted to implement Autolayout, and because a textfield really can be “any height”, the AL code is causing the issue

Slightly OT, sorry, but in WE, FWIW, I have textfields and popupmenus that are identical heights in the inspector and the IDE, but different heights when viewed in a browser :frowning:

Popup menus (in Windows but not in macOS) change height at runtime based on the font size

This particular issue manifests on both platforms, maybe it’s a browser thing - I’ve only tested on Chrome.

sorry… I was talking Desktop… not web

The only way to achieve this “bug” (I would call it a feature) is to change a control’s super to iOSTextField.

You can actually have a TextField at any given height by placing an iOSLabel first, setting its constraints then changing the super to iOSTextfield.

Jeremie’s suggestion about making things labels first and then changing the super to iosTextField (or Segmented control) worked.

All I need do now is remember to create things that way.

Thanks, as always.

-Bob