0
- 的UIView(容器)
- 的UIView。 (1)的子視圖 - 下圖中的深藍色
- UIView。 (1)的子視圖 - 下圖中的紫色
- UILabel。 edges.equalToSuperview()
我試圖做到:
的事情是,我想向的UILabel旋轉3PI/2(270°)。一旦我完成旋轉,它沒有正確放置。
這是怎麼看起來像通過設置edges.equalToSuperview()和270°旋轉:
我已經試過這(但它導致崩潰):
myLabel.makeConstraints { make in
make.top.equalTo(containerView.snp.left)
make.right.equalTo(containerView.snp.top)
make.left.equalTo(containerView.snp.bottom)
make.bottom.equalTo(containerView.snp.right)
}
崩潰描述:
*** Terminating app due to uncaught exception 'NSInvalidLayoutConstraintException', reason: 'Constraint improperly relates anchors of incompatible types: <SnapKit.LayoutConstraint:[email protected]#250 MyProject.MyLabel:0x7fcc2201ca80.top == UIView:0x7fcc2201bd30.left>'
任何想法,我可以在這裏做什麼?
非常感謝! –