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

Weird spacing before starting animation #138

Open
DantePuglisi opened this issue Aug 14, 2020 · 2 comments
Open

Weird spacing before starting animation #138

DantePuglisi opened this issue Aug 14, 2020 · 2 comments

Comments

@DantePuglisi
Copy link

First of all, great library!

I'll introduce the problem first, check the spacing from the leftmost 3 to the comma, that spacing increases on the first animation and then stays the same. It seems like a small issue but it can be really seen when using the app.

MorphingLabel bug

I am using LTMorphingLabel inside a UITableViewCell and the only way I could find to make it work was by adding it as a subview, like this:

titleLabel?.removeFromSuperview()
titleLabel = nil

titleLabel = LTMorphingLabel()
titleLabel!.morphingEnabled = false /// If I don't implement this morphingEnabled false/true the label would animate every time it's shown
titleLabel!.delegate = self
titleLabel!.morphingEffect = .evaporate
titleLabel!.text = formattedNumber /// This is a number formatted to include a comma every 3 characters counting from the right
titleLabel!.textAlignment = .center
titleLabel!.font = UIFont(name: "Silka-SemiBold", size: 28)
titleLabelContainer.addSubview(titleLabel!)
titleLabel!.morphingEnabled = true

My first thought was maybe some attributedText could be the issue but couldn't find out why this is happening, any help would be appreciated.

@okhanokbay
Copy link

Having the same with some fonts like Campton. I don't have the same weirdness with Helvetica-Neue for example. What can we do to prevent this behavior?

@DantePuglisi
Copy link
Author

I have no idea, I couldn't figure out how to fix this. @lexrus

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