1

I am fairly new to Xamarin.iOS. Coming from Xcode, I have noticed that applying constraints in the iOS designer (I am using Visual Studio) is very different. One needs to double tap to get the constraints gizmo. However, it is limited to only 3 constraints: align, spacing and size. Xcode, however, provides many more options such as setting the aspect ration, priority and equality, which I did not see in Visual Studio. Also, ctrl+drag does not seem to do anything (unlike Xcode where a menu pops up) I also noticed that the constraints gizmo does not work when editing a navigation bar. No matter how many times I clicked on the bar, the gizmo never appeared (maybe a bug?).

as far as I know, the tutorials on autolayout in Xamarin are restricted to paid Xamarin University subs so I am hoping someone here can help me figure it out.

Thanks,

Iain Smith
  • 9,230
  • 4
  • 50
  • 61
Rob8861
  • 433
  • 1
  • 4
  • 14
  • one thing I forgot - using the "add recommended constraints" button produces odd results which 95% of the times, will only work in one orientation. – Rob8861 Apr 25 '16 at 15:33
  • If you are using a macOS, you can use Xcode interface builder to achieve the same : https://stackoverflow.com/a/47587550/3150830 – Ashildr Dec 01 '17 at 06:08

1 Answers1

1

I dont think it has those features right now, the "iOS Designer" seems to be limiting in regards to constraints, I just use Interface Builder when doing more that simple constraints because of this.

Doesnt even have constraint width to superview width, c'mon man.

Also the info here in the Xamarin docs is pritty much the same as the Xam university.

Iain Smith
  • 9,230
  • 4
  • 50
  • 61
  • it's actually very frustrating. Nowadays, auto-layout is pretty much a must. by the way, you mentioned that you use IB for editing? how do you actually do that? Do you just copy the storyboard file to your mac and edit it in Xcode, then copy it back to Visual Studio? would that work? – Rob8861 Apr 25 '16 at 17:30
  • That would work but I just check the code out on both machine and commit the storyboard/nib changes on the mac with IB. – Iain Smith Apr 25 '16 at 17:48
  • oh yes, a source control can make life easier in that situation. I just wasn't sure if the storyboard file is compatible across both frameworks (xamarin ios designer & IB). So basically I can do all the fancy stuff in IB and it would work in Visual Studio right? – Rob8861 Apr 25 '16 at 18:11