That’s weird. It looks like the label’s frames are shrunk to their minimum. When you tint them with a backgroundcolor, you will see that their frame is only the size of the text which will always be centered.
I tried different ways including putting the labels besides the iOSView, removing them from their parent and adding them to the ScrollView, but with the same result. Setting the label’s frame doesn’t help either. Finally I put them on a colored rectangle and started the removefromsubview/addtosuperview sequence timer triggered later. Before, the rectangle is colored and I can scroll everything around. When the timer fires and copies only the rectangle (the labels being subviews of it, so they will be transferred too), the color dispappears and both labels center again. The controls simply lose a part of their properties when the are attached to the contentview.
Another attempt with a rectangle bigger than the iOSView containing both labels could be resized to be shown in full, but without the second label which was placed below the iOSView’s lower border.
I was about to write you I’m fully clueless, then I tried:
[code] dim myview as new AppleView (FoundationFrameWork.NSMakeRect (0,0,600,900))
myview.BackgroundColor = AppleColor.BlueColor // don’t need this. In case it’s Black without use ClearColor
AppleScrollViewer1.ContentView = myview
dim d as new AppleLabel (FoundationFrameWork.NSMakeRect (5,40,200,40))
d.Caption = “Testlabel”
myview.AddSubview d
dim d2 as new AppleLabel (FoundationFrameWork.NSMakeRect (5,90,200,40))
d2.Caption = “And another testlabel”
myview.AddSubview d2
dim d3 as new AppleLabel (FoundationFrameWork.NSMakeRect (5,800,200,40))
d3.Caption = “And another testlabel way below”
myview.AddSubview d3[/code]
which finally works but starts in a full-contentview magnification and the scrolling is not reliable, at least on iOS Simulator. it mostly works paged or via doubletap only.
I could imagine the reason this works at least somehow is some part of the Xojo controls goes out of scope and therefore lose some of the properties. Admittedly that’s just a wild guess. But have you tried buffering your iOSLabels somewhere to make them live longer than the open event? I had forgotten I do so in the stitch method of the scrollview. I buffer the original views in the ViewArray() property of AppleScrollView. Otherwise the attached views wouldn’t work.
BTW, in case you need to read some of the Scrollview properties it’s better to use the DidMoveToWindow event. During the Open event, some properties of the control have not been set.