I am not sure if this is a new requirement, but I solved this by adding [self layoutIfNeeded];
before doing any cornerRadius
stuff. So my new custom awakeFromNib
looks like this:
- (void)awakeFromNib {
[super awakeFromNib];
[self layoutIfNeeded];
self.tag2label.layer.cornerRadius=self.tag2label.frame.size.height/2;
self.tag2label.clipsToBounds=YES;
}
Now they all appear fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…