0
let centerPointX = colorSizeGuide.bounds.midX/2
let centerPointY = colorSizeGuide.bounds.midY/2
let circleWidth: CGFloat = 10
let circleHeight: CGFloat = 10
shape.path = UIBezierPath(ovalIn: CGRect(x: centerPointX + circleWidth/4, y: centerPointY + circleHeight/4, width: circleWidth, height: circleHeight)).cgPath
shape.strokeColor = UIColor(r: 160, g: 150, b: 180).cgColor
shape.fillColor = UIColor(r: 160, g: 150, b: 180).cgColor
shape.anchorPoint = CGPoint(x: 0.5, y: 0.5)
shape.lineWidth = 0.1
shape.transform = CATransform3DMakeScale(4.0, 4.0, 1.0)
colorSizeGuide.layer.addSublayer(shape)
這是發生了什麼事。我需要的CAShapeLayer留在灰色的小區域的中間:爲什麼CAShapeLayer在縮放時不能集中到我的UIView?