iOS Container Control Width

Hi everybody!

I have a view with a scrollable area in that view. I have set the content of that scrollable area to a container control. The scrolling works fine, the only question I have is: how can I set the width of the container control?

The issue is that on smaller devices you have to scroll to the right to see all controls, on larger devices only half of the screen is being used. In all the controls in that container control I never use a static width value, I always use relative values, like for example for a label I have:
Left: Parent, Left, Offset 0
Right: Parent, Right, Offset 0.

I would assume that this label would span the entire width of the screen (and not further), regardless of the device’s screen resolution. It works if I place this label directly on the view instead of the container control.

How can I set the width values to make this work? I am not a native speaker, I hope I could explain the problem properly.

Thanks in advance


When you sent the content of a scrollable area only the top and left iOSConstraints are automatically created.

Dim cons as iOSLayoutConstraint cons = new iOSLayoutConstraint(content, _ iOSLayoutConstraint.AttributeTypes.Width, _ iOSLayoutConstraint.RelationTypes.Equal, _ scrollarea, _ iOSLayoutConstraint.AttributeTypes.Width, _ 1.0, 0) cons.Active = True scrollarea.AddConstraint(cons)

That works like a charm, thank you!