Open snc001 opened 6 years ago
That's pretty weird, because line 1153 is where MarqueeLabel just returns the mask of the base view layer, and the only place the mask layer is set is at line 1029…where it is set as a CAGradientLayer.
Does your project code mask the MarqueeLabel in any way, by setting the aLabel.layer.mask
property?
Spot on! Yes I do for custom border rounding.
let nameLabelEdge = CAShapeLayer() nameLabelEdge.bounds = nameLabel.frame nameLabelEdge.position = nameLabel.center nameLabelEdge.path = UIBezierPath(roundedRect: nameLabel.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize(width: 9, height: 9)).cgPath nameLabel.layer.mask = nameLabelEdge
That is exactly how i have it at the moment
So yep that's the reason, your CAShapeLayer is replacing the CAGradientLayer that MarqueeLabel assigns to itself to handle the fading at the left and right edges.
There's probably a way for MarqueeLabel to mask itself without using the top layer mask so that it doesn't conflict, but I'll have to look into it. I think the quick and easy way for you to fix it right now would be to just put your MarqueeLabel instance inside a wrapper UIView and then mask that wrapper view.
Yea that's exactly what i did as a work around =)
Usage Details
Steps to Reproduce the Problem
Is there something that I have missed or have done wrong??
Any help is much appreciated :)