1
Я не уверен, как установить UIImageView в круговой CAShapeLayer, который я создаю. В настоящее время UIImageView (imageViewObject) слишком большой и скрывает два других UILabels, которые я сделал. Какие-нибудь советы?Как установить UIImageView внутри CAShapeLayer?
let imageViewObject = UIImageView(frame:CGRectMake(0, 0, 100, 100))
let statusLabel = UILabel(frame: CGRectMake(0, 0, 200, 20))
let percentageLabel = UILabel(frame: CGRectMake(0, 0, 200, 20))
override func layoutSubviews() {
super.layoutSubviews()
circlePathLayer.frame = bounds
circlePathLayer.path = circlePath().CGPath
statusLabel.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds))
percentageLabel.center = CGPointMake(CGRectGetMidX(self.bounds), 4 * frame.height/5)
imageViewObject.center = CGPointMake(CGRectGetMidX(self.bounds), 1 * frame.height/5) //This doesn't fit this inside
}