Auto layout constraints in ios

Hello All,

I have started a project recently.i m designing a screen giving each view constraints but somehow in Mac,the constraints are not maintaing for all screen sizes.am I missing something?

Answers

  • BytesGuyBytesGuy GBXamarin Team Xamurai

    It could be that you have set the constraints for a specific size class. Therefore on a different size class those constraints will not be installed. Try setting your constraints to "Any" for both width and height.

    Essentially this is happening to your constraints - they are being defined in an "Exclusion Case":

    https://developer.xamarin.com/guides/ios/platform_features/introduction_to_Unified_Storyboards/#Excluding_an_Element_from_a_Size_Class

  • UrvashiThakkarUrvashiThakkar INMember ✭✭
    @BytesGuy no it wasn't the case I was setting constraints in any to any.still they didn't work.

    For m it was xamarin studio version issue.downgrading fixed the issue.
    Thanx for suggestion though
  • BytesGuyBytesGuy GBXamarin Team Xamurai

    @UrvashiThakkar Can you share a sample project that exhibits this issue? If this is a bug we would like to investigate. Cheers

  • AshleyGazichAshleyGazich USMember, Xamarin Team Xamurai

    Would it be possible to share a sample project and steps to reproduce the constraints issue? If you’d like to keep the sample private, it can be messaged to me directly.

    I’d also like to get your full version information from Xamarin Studio > About Xamarin Studio > Show Details > Copy Information [button] to help investigate this behavior.

    Thank you!

  • UrvashiThakkarUrvashiThakkar INMember ✭✭

    @BytesGuy & @AshleyGazich ,Sample project won't be possible for me right now.But i can tell u when i was facing the issue i had
    Xamarin studio version : 6.1.3
    Xamarin.ios : 10.2
    When i downgraded to 6.1.1, the issue got resolved.

Sign In or Register to comment.