MarqueeLabel icon indicating copy to clipboard operation
MarqueeLabel copied to clipboard

MarqueeLabel scrolling animation is paused

Open howoften opened this issue 4 years ago • 3 comments

when i set a scrolling MarqueeLabel.attrbuteText, MarqueeLabel.sublabel.origin is set to (0,0). this is not what i want, animation seems to start again, not continuous. is there any way for me to avoid this behavior?

i just want MarqueeLabel.sublabel.origin to be continuous not (100, 20) --> (0,0)

howoften avatar Dec 07 '21 14:12 howoften

Can you post how you’re configuring your label instance? I’m not exactly sure what you’re seeing.

cbpowell avatar Dec 07 '21 14:12 cbpowell

Can you post how you’re configuring your label instance? I’m not exactly sure what you’re seeing.

Thanks for your reply! i have a scrolling MarqueeLabel in a view, and its attrbuteText need to be changed many times, every time i change the MarqueeLabel's attrbuteText, sublabel.frame will be reset, and animation will be readd. can i avoid these? i just want to change its attrbuteText, use its previous animation.

code sample: let rollingLabel = MarqueeLabel(frame: frame, rate: 35, fadeLength: 15.0) rollingLabel.animationDelay = 0.0 rollingLabel.type = .continuous rollingLabel.textAlignment = .left rollingLabel.lineBreakMode = .byTruncatingTail rollingLabel.trailingBuffer = 25

howoften avatar Dec 08 '21 02:12 howoften

Sure thing!

Unfortunately MarqueeLabel doesn’t currently handle changing attributes/text without causing the label to reset. Sorry!

cbpowell avatar Dec 08 '21 14:12 cbpowell