OK. Here’s where I am getting hung up. Let’s start with a basic control that I have created. I have the canvas for one of the controls in the IDE on the view. It’s height is 532.
In the open event of the control in desktop I have the following code:
self.Width = ScaleFactor*Picture_SliderWidth
Picture_SliderWidth above is a computed property with this in the getter:.
If UseLEDBar Then
Return 165
Else
Return 107
End If
ScaleFactor is a computed property with the code below in the Get method:
Return Self.Height/463
Now this works swimmingly well.
In IOS, I have the following:
[code]MyWidth = New iOSLayoutConstraint(Self, _
iOSLayoutConstraint.AttributeTypes.Width, _
iOSLayoutConstraint.RelationTypes.Equal, _
Nil, _
iOSLayoutConstraint.AttributeTypes.None, _
1,mWidth,1000)
MyWidth.Offset = ScaleFactor*Picture_SliderWidth
Self.AddConstraint(MyWidth)[/code]
The computed properties are the same in iOS as in desktop. But for some reason the code just wasn’t working. Then I discovered that in the ScaleFactor computed property, self.height is ALWAYS being reported as 100. It’s not reporting the height of the control instantiated on the view, but some default height.
This is why none of my stuff is working.
Why is the height of the control not being reported properly. Note, all this code is in a custom control subclass of iOSCanvas.