The iOSScrollableArea and its content are two different elements.
When setting the content of an iOSScrollableArea, the content will be locked to the top left until you define auto-layout constraints.
To display any ContainerControl centered in an iOSScrollableArea, you will need this method in a module:
[code]Public Sub SetContentFullScreen(extends scroll as iosScrollableArea, content As iOSControl, FullWidth As Boolean = False)
scroll.Content = content
//Center the cc
Dim cons As iOSLayoutConstraint
cons = New iOSLayoutConstraint(content, _
iOSLayoutConstraint.AttributeTypes.CenterX, _
iOSLayoutConstraint.RelationTypes.Equal, _
scroll, _
iOSLayoutConstraint.AttributeTypes.CenterX, _
1.0, 0)
cons.Active = True
scroll.AddConstraint(cons)
If FullWidth Then
cons = New iOSLayoutConstraint(content, _
iOSLayoutConstraint.AttributeTypes.Width, _
iOSLayoutConstraint.RelationTypes.Equal, _
scroll, _
iOSLayoutConstraint.AttributeTypes.Width, _
1.0, 0)
cons.Active = True
scroll.AddConstraint(cons)
cons = New iOSLayoutConstraint(content, _
iOSLayoutConstraint.AttributeTypes.Height, _
iOSLayoutConstraint.RelationTypes.GreaterThanOrEqual, _
scroll, _
iOSLayoutConstraint.AttributeTypes.Height, _
1.0, 0)
cons.Active = True
scroll.AddConstraint(cons)
Else
Break
End if
End Sub
[/code]
And call it in the iOSView.Open event (or afterwards if adding the Container by code):
theScrollableArea.SetContentFullScreen(theContainerControl, False) //Or True if you want it to be fullwidth