代码之家  ›  专栏  ›  技术社区  ›  Arvind Chourasiya

Xamarin iOS:无法对Visual Studio 2017中的控件设置约束

  •  0
  • Arvind Chourasiya  · 技术社区  · 7 年前

    此处设置约束 enter image description here 我想设置约束 UIImageView 以便控制所有屏幕的外观。 切换到后 约束编辑模式 我为设备1(比如iPhone X)设置了限制条件,然后选择了另一个设备(比如iPhone SE)并为其设置了限制条件。现在,当我切换iPhone X的布局时,它受到了干扰,我如何才能正确设置约束。我正在通过网络连接到MAC的Windows计算机中使用Visual Studio 2017。 请查看随附的屏幕截图。第一代iphone X和第二代iphone SE enter image description here

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  1
  •   Arvind Chourasiya    7 年前

    确保已设置 足够的 该imageView上的约束。 要使图像在视图中居中,应定义其位置和大小。

    ###Align: 
    CenterX to:Superview=0
    CenterY to:Superview=0
    
    ###Size:
    Width=something
    Height=something
    

    然后,您可以使用各种设备在该图像上看到相同的效果。