I just updated my Xamarin version and I found that I cannot constraint to the leading edge or trailing edge of the Container View. However, I can only constraint to the Leading margin or Trailing margin(Picture Attached). Is there a way to let me constraint to the edges of a super view not the margin?
Asked
Active
Viewed 628 times
3 Answers
2
Here's my workaround for the time being:
- Set the constraint in the designer, then save and close it.
- Open the storyboard in a text editor and update the constraint element's attribute from "leadingMargin" (or "trailingMargin") to just "leading" (or "trailing")
- Reopen the storyboard in the designer and it should then show up correctly.
FYI, this doesn't appear to be an issue in Xamarin Studio, just VS.

Copo
- 86
- 4
-
Thank you, it should work by editing the xml. The question posted one month ago, I solved it by using XCode designer, it is much nicer than Xamarin's. See https://forums.xamarin.com/discussion/46723/cant-use-xamarin-storyboard-editor for all the complains about Xamarin's IOS designer. LOL~ – Student222 Jul 03 '17 at 17:51
-
I would like to state that this is also an issue for Xamarin Studio. – Nico Jul 06 '17 at 22:41
0
I was able to resolve this in Visual Studio 2017 interface by doing the following:
- Set the constraints to the margin, like OP's image shows.
- Click on the newly added constraint in the designer so it's selected.
- In the
Properties
click theWidget
tab and find theLayout Constraint
section. One of the items under this section will have aRelative to Margin
checkbox checked. Uncheck that, then set theConstant
from its default (mine was 20) to 0.

StoriKnow
- 5,738
- 6
- 37
- 46