//更改锚点
func setViewAnchorPoint(view: UIView, anchorPoint: CGPoint) {
view.layer.anchorPoint = anchorPoint
view.top -= (0.5 - anchorPoint.y) * view.height
view.left -= (0.5 - anchorPoint.x) * view.width
}
//更改锚点
func setViewAnchorPoint(view: UIView, anchorPoint: CGPoint) {
view.layer.anchorPoint = anchorPoint
view.top -= (0.5 - anchorPoint.y) * view.height
view.left -= (0.5 - anchorPoint.x) * view.width
}
本文标题:iOS修改锚点后重置frame
本文链接:https://www.haomeiwen.com/subject/ohxluktx.html
网友评论