如何在 Xamarin Studio 中使用 iOS 设计器添加高度/宽度约束? [英] How to add a height/width constraint with iOS Designer in Xamarin Studio?

查看:17
本文介绍了如何在 Xamarin Studio 中使用 iOS 设计器添加高度/宽度约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所示,我想使用 Pin 按钮添加像 Xcode 一样的约束,但 Xamarin Studio 中没有这样的按钮.我不知道在哪里添加高度约束.

As the title indicates I want to add a constraint like with Xcode with the Pin button, but there is no such button in Xamarin Studio. I can't figure out where do I add a height constraint.

对于高度约束,我的意思是像这样的约束

With height constraint I mean a constraint like

viewA.height = null * 乘数 + 常数

viewA.height = null * multiplier + constant

NSLayoutAttribute.NoAttribute 应该使用!

如何使用 iOS Designer 做到这一点?

How can I do that with iOS Designer?

推荐答案

您必须在高度/宽度引脚上左键单击一次.然后使用当前帧大小为您创建约束.
更新:在当前的 Xamarin 中,当左键单击I-bar"引脚时,您有两个选择:
(1) 宽度"(或高度),它创建一个恒定宽度"(高度),例如宽度 = 100",和
(2) Aspect Ratio",它创建了一个宽度到高度的约束,例如宽度 = 1:1 * 高度".

You have to left-click once on the heigth/width pin. Then the constraint is created for you with the current frame size.
UPDATE: In current Xamarin, when left-click on "I-bar" pin, you get two choices:
(1) "Width" (or Height), which creates a "Constant Width" (Height) e.g. "Width = 100", and
(2) "Aspect Ratio", which creates a Width-to-Height constraint, e.g. "Width = 1:1 * Height".

这篇关于如何在 Xamarin Studio 中使用 iOS 设计器添加高度/宽度约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆