Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarqueeLabel scrolling animation is paused #276

Open
howoften opened this issue Dec 7, 2021 · 3 comments
Open

MarqueeLabel scrolling animation is paused #276

howoften opened this issue Dec 7, 2021 · 3 comments

Comments

@howoften
Copy link

howoften commented Dec 7, 2021

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)

@cbpowell
Copy link
Owner

cbpowell commented Dec 7, 2021

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

@howoften
Copy link
Author

howoften commented Dec 8, 2021

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

@cbpowell
Copy link
Owner

cbpowell commented Dec 8, 2021

Sure thing!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants