简体   繁体   English

使用Xamarin iOS设计器添加等宽约束

[英]Add an Equal Widths constraint using the Xamarin iOS Designer

In my Xamarin app, I am trying to add a single view to a scroll view. 在我的Xamarin应用程序中,我试图将单个视图添加到滚动视图。 Based on recommendations online, I am trying to set an Equal Widths Constraint between the view and the main view of the controller, but I don't see any way to do it in the Xamarin Studio or Visual Studio designers. 根据在线建议,我试图在控制器的视图和主视图之间设置“等宽约束”,但是在Xamarin Studio或Visual Studio设计器中我看不到任何方法可以做到。

Can this type of constraint be added using the designer? 可以使用设计器添加这种约束吗?

You can set equal widths between views by doing the following (screenshots to follow): 您可以通过执行以下操作(在以下屏幕截图中)在视图之间设置相等的宽度:

  1. In the Xamarin iOS Designer, put the designer in Constraint Editing Mode 在Xamarin iOS设计器中,将设计器置于Constraint Editing Mode
  2. Click the view you want to make equal width to another (in my screenshot, the Label ). 单击您要使其宽度与另一个视图相等的视图(在我的屏幕截图中, Label )。
  3. This reveals the view constraints. 这揭示了视图约束。 Hold CTRL , then click and drag on the sideways I in the middle-bottom of the view. 按住CTRL ,然后单击并拖动视图中间底部的侧面I You'll notice a blue line appears. 您会注意到出现一条蓝线。 Hover your mouse over the destination view you want to make equal widths to and let go. 将鼠标悬停在要与宽度相等的目标视图上,然后松开。

在此处输入图片说明

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM