I have a cornerRadius
set on a UIView
and a UIImageView
inside the same UIView
. I am calculating the corner radius with RockProfileView.frame.size.height / 2
but the UIView stopped showing in iOS 10.
After further checking i found the value of RockProfileView.frame.size.height / 2
is coming out to be 1000.0 while the width and height constraint is set to 64.0
When I hardcoded the RockProfileView.layer.cornerRadius = 32
to 64/2 it works just fine.
What could be the issue ?
Full code:
RockProfileView.layer.cornerRadius = RockProfileView.frame.size.height / 2
RockProfileView.clipsToBounds = true
RockProgressView.layer.masksToBounds = true
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…