I meant to follow up with this.
It’s still not quite right.
I get the width of the scrollable area and set a new container to add the elements that will show up when scrolled. I’m setting Paging to true.
I then set the container’s width to the scrollable area’s width x the number of controls I’m embedding.
I loop through each control and set its with to the width of the scrollable area, and left edge to the correct constraint - either the container’s left edge or the right edge of the container that proceeded it.
There is some disconnect because as I swipe the next controls appear cut off or at least not correctly paging (see one sticking out).
Here’s the code. Any hints about what I might be doing wrong would be appreciated.
(Could it be not compensating for the scrollbar width or something?)
For i As Integer = 0 To cont.ControlCount-1
Var cv As MobileControl=cont.ControlAt(i)
Var WidthC As New iOSLayoutConstraint(cv,iOSLayoutConstraint.AttributeTypes.Width, iOSLayoutConstraint.RelationTypes.Equal, _
cont, iOSLayoutConstraint.AttributeTypes.Width,1/cont.ControlCount,0)
Var HeightC As New iOSLayoutConstraint(cv,iOSLayoutConstraint.AttributeTypes.Height, iOSLayoutConstraint.RelationTypes.Equal, _
Nil, iOSLayoutConstraint.AttributeTypes.None,1.0,h)
Var LeftC As iOSLayoutConstraint
If i=0 Then
leftc= New iOSLayoutConstraint(cv,iOSLayoutConstraint.AttributeTypes.Left, iOSLayoutConstraint.RelationTypes.Equal, _
cont, iOSLayoutConstraint.AttributeTypes.Left,1.0, 0 )
Else
leftc = New iOSLayoutConstraint(cv,iOSLayoutConstraint.AttributeTypes.Left, iOSLayoutConstraint.RelationTypes.Equal, _
cont.ControlAt(i-1), iOSLayoutConstraint.AttributeTypes.Right,1.0, 0 )
End If
cont.AddConstraint heightC
cont.AddConstraint widthC
cont.addconstraint leftC
Next