I'm struggling with the fact that adding a constraint to my app is causing the app just to quit in Xojo with no explanation. Here's the situation:
1.) I have a 5 controls that I want to evenly space across the display.
2.) I have these set up with both width and left constraints in the IDE. It seems like if you don't have constraints initially in the IDE it's nearly impossible to even attempt to place controls on the screen as they do very bizarre things. Right now the first control on the left side is tied to the left of the view with a fixed offset.
3.) I want to calculate both the widths for each control and set that as well as set the left position of the first control based on the width of all the controls so that the controls are all centered.
4.) When the program starts, I remove the width constraint in the open event of each control. Code in the parent subclass for the control then sets a new constraint and the width by setting an offset. This works fine.
5.) I then attempt to set the left value of the first control by removing the left constraint and adding a new constraint. As soon as I apply the new constraint, the debugger just quits. Silently fails. The app still appears to be running in the simulator and I have to reboot the simulator device in order to be able to continue working. Here is my code:
Me.RemoveConstraint(Self.Constraint("MyLeft")) Dim TheLeft As iOSLayoutConstraint TheLeft = New iOSLayoutConstraint(Me, _ iOSLayoutConstraint.AttributeTypes.Left, _ iOSLayoutConstraint.RelationTypes.Equal, _ Me.Parent, _ iOSLayoutConstraint.AttributeTypes.Left,1,0,1000) Me.AddConstraint(TheLeft)
What I am doing wrong? For the reference control I've tried self, me.Parent, View1, etc. All result in this crash. I've change relationship types around. Still the crash.
What is going on?