简体   繁体   English

故事板:使用自动布局约束将自定义UIView中的按钮与父UIView中的另一个按钮对齐?

[英]Storyboard: align button in custom UIView to another button in parent UIView using auto-layout constraints?

Assume a custom UIView, CustomView, that is designed with a Xib file. 假定使用Xib文件设计的自定义UIView,CustomView。 Inside CustomView is a UIButton, CustomButton. 在CustomView内部是一个UIButton,CustomButton。

ParentView is a UIView that contains CustomView. ParentView是一个包含CustomView的UIView。

With Storyboard, is it possible to create an auto-layout constraint that center aligns CustomButton with another button in ParentView? 使用情节提要,是否可以创建一个自动布局约束,以使CustomButton与ParentView中的另一个按钮居中对齐?

No it is not possible to do what you are trying to do in storyboard. 不,您不可能在情节提要中做您想做的事情。 You would have to do it programatically. 您将必须以编程方式进行操作。

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

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