Forum Xamarin.iOS

Greater than or equal constraint not working?


I am currently porting a storyboard-based iPhone app to Xamarin - copied the storyboard and ported the code to c#. Now I get strange behaviour.

In one of my views I use a greater-than constraint to reposition some elements based on a table, which I resize in code (I change its height constraint)
This worked perfectly fine in objective-c, the height constraint got changed and all other controls moved without problems.

I tried the same in Xamarin, but apparantly the greater than constraint gets deleted - I can't find it anywhere while debugging - and the repositioning no longer works.
objective-c code:

[UIView animateWithDuration:0.01 animations:^{
self.heightConstraint.constant = 10.0f; //the constraint as outlet

Is this a bug or do I need to some additional coding to preserve the greater than constraint?



    After some debugging:

    The NSLayoutConstraint.Relation gets changed from greaterthanorequals to equals when running the app.

    I'm pretty sure that this is not the wanted behaviour and should be considered as a bug.


    Found the problem - the storyboard editor in Visual Studio showed the constraint as greaterthan, while it was equals internally. Editing the storyboard in XCode solved this issue.
    Conclusion: Storyboard editor in VS still has some bugs (e.g. erratic behaviour after multiple form factor switches)
    Question is answered with this

Sign In or Register to comment.