0

enter image description here

Im using xamarin designer with autolayout and cannot align the UITabBar to the left & right edges of the root. There is always a small margin how to remove it?

Ramy Zbeidy
  • 176
  • 8

4 Answers4

2

If you are in Xamarin using Visual Studio I finally discover how to tackle this annoying problem.

Click on the widget or view in the storyboard. In the properties window->layout you can see the constraints. Click on the constraint.

Before I was using -20 for constraints: enter image description here

Now I fixed by having a constant of 0 and changing the constraint configuration: enter image description here

Just remove the selection on the "Relative to Margin" checkbox.

Gustavo Baiocchi Costa
  • 1,379
  • 3
  • 16
  • 34
1

Set the constant to -20 on the Trailing Margin Space and Leading Space layout elements to the Superview. I have no idea whether this is the preferred way to do this but it worked for me on my Table View.

Energy CJ
  • 125
  • 2
  • 11
0

Xcode has an option not use margins when a constraint is added.

In the iOS designer in Visual Studio, there doesn't seem to be an option when a constraint is being created.

Xcode & Visual Studio constraint margins

A work around is to create the constraint and then edit it after it has been created.

On another note, you might review why you're not using a UITabBarController which would place the Tab Bar correctly for you.

-1

You need to uncheck the Constraint to Margin option when giving constraints for left and right using auto layout

Link1

Link2

Auto Layout guide

Singhal2
  • 450
  • 7
  • 22
  • All of your advice points to iOS native interface designers, I can't see any xamarin specific information in there, and trying to apply the answers in those links to xamarin in visual studio actually isn't the same. – JoeTomks Jul 18 '17 at 07:34