自动布局[更新约束"按钮,但是,计算比例,而不是持续? [英] Autolayout "Update Constraints" button, but, calculate proportion, not constant?

查看:141
本文介绍了自动布局[更新约束"按钮,但是,计算比例,而不是持续?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短版:

更新限制按钮的功能是,它计算/更新的现有约束的数值为你(根据视觉至情节板中的变化) 。然而,这似乎只计算/更新'的的价值。这是不是在比例 - 模式紧张的情况下非常有用。如何使用更新限制按钮来修改乘数的数值,而不是恒的数值?

The function of the 'Update Constraints' button is that it calculates/updates the numerical values of an existing constraint for you (based on visual changes in the storyboard). However, it seems to only calculate/update the 'Constant' value. This is not useful in the case of proportional-mode constraints. How to use 'Update Constraints' button to modify the 'Multiplier' numerical value rather than 'Constant' numerical value?

例如,所有的约束条件的正确到位。你想改变一个项目的高度。通过拖动这样做视觉...

Example, all constraints are correctly in place. You wish to change the height of an item. Do so visually by dragging...

在这里输入的形象描述

使用更新限制...

在这里输入的形象描述

它为您计算/更新的恒新值...

it calculates/updates the new value of "Constant" for you...

在这里输入的形象描述

(注意,相反的功能,更新帧也很关键;它移动视觉方面的地方你已经改变了文本输入值)

(Note that the opposite function, "Update Frames" is also critical; it moves the visual side to where you have changed the text entry values.)

这太棒了。但是。

所以,你要在值保持在零,你想让它重新计算的乘数为您服务。

so, you want the Constant value to remain at zero, and you want it to recalculate the Multiplier for you.

(在上面的例子来看,它应该从0.075会改变倍频说0.08123)。

(Looking at the example above, it should be changing the multiplier from .075 to say .08123.)

有没有办法做到这一点?

Is there a way to do this?

如何使更新限制按钮,影响到倍增器,而不是常数?它是一个功能键,或者??

How to make "Update Constraints" button affect the "Multiplier", rather than the "Constant"? Is it a key modifier, or??

推荐答案

感谢阐述你的问题。

答案是NO。 更新限制按钮始终修改约束的常量值。这是由事实 NSLayoutConstaint 的恒定属性<支持href=\"https://developer.apple.com/library/ios/documentation/AppKit/Reference/NSLayoutConstraint_Class/#//apple_ref/occ/instp/NSLayoutConstraint/constant\"相对=nofollow>读写但乘数是<一个href=\"https://developer.apple.com/library/ios/documentation/AppKit/Reference/NSLayoutConstraint_Class/#//apple_ref/occ/instp/NSLayoutConstraint/multiplier\"相对=nofollow>只读。

The answer is NO. "Update constraints" button always modifies the constant values of the constraints. This is supported by the fact NSLayoutConstaint's constant property is read write but multiplier is readonly.

这篇关于自动布局[更新约束&QUOT;按钮,但是,计算比例,而不是持续?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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