简体   繁体   中英

How to add a height/width constraint with iOS Designer in 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 * multiplier + constant

ie NSLayoutAttribute.NoAttribute should be used!

How can I do that with iOS Designer?

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) eg "Width = 100", and
(2) "Aspect Ratio", which creates a Width-to-Height constraint, eg "Width = 1:1 * Height".

了解如何创建高度约束

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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