Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个堆栈,里面有 2 个视图,黄色占堆栈的 70%,绿色占另外 30%。我想编写一个按钮,单击该按钮:
myStack.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
我已经用“等宽约束完成了 70:30 的事情,如下所示:宽度
我如何才能实现此功能以及将一切恢复正常的代码是什么?期望的输出
Fill Proportionally
0.7 of superview.width
0.3 of superview.width
firstView.isHidden = true
firstView.isHidden = false