Giter Club home page Giter Club logo

Comments (9)

Spacelapp avatar Spacelapp commented on May 18, 2024 1

Well the demo says "TableView coming soon..."
I ended up implementing my own Marquee Label using a scrollview with a timer for auto scroll. Result doesn't have any performance problems 👍

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

Yeah - MarqueeLabel depends on Core Animation, and lots of animations in a scrolling table view is generally bad for performance. There are a few changes you can make that will help with scrolling and performance in general when using MarqueeLabel in a table view:

  • Set the background color of the label to a totally opaque color, rather than using clear.
  • Labelize as much as possible, especially when the table view is scrolling, or at least hold scrolling (not pause!) and reset all the labels to the home position as soon as table view scrolling begins.
  • If you can avoid it, don't use edge fades. This allows the view to be totally opaque.

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

I meant to note - the Objective-C repo has a table view demo now. You can take a look at that to see one possible implementation.

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

Nice! Just trying MarqueeLabel with a fully-opaque background color might get you a significant improvement if you wanted to try that.

And actually I finally got around to implementing the Swift table view demo a few days ago, but haven't pushed it to the master branch yet: https://github.com/cbpowell/MarqueeLabel/tree/combination/MarqueeLabelSwift. It's part of an attempt at combining the Obj-C and Swift repos together.

from marqueelabel-swift.

Spacelapp avatar Spacelapp commented on May 18, 2024

I already tried that, but the performance is still bad on a device :(

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

I'll reopen this for now - I'm not sure how much improvement there is to gain within MarqueeLabel itself (since it's really just CAKeyframeAnimations moving the frame), but we can maybe figure out the best practice to get max performance.

Can you describe your configuration? When you say poor performance, do you mean table view scrolling, the label animations, or both?

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

Also, poor performance with large font sizes has been noted before.

from marqueelabel-swift.

cbpowell avatar cbpowell commented on May 18, 2024

Going to close this again for now, since this repo is now fully deprecated in favor of the main MarqueeLabel repo. It sounds like you fixed your specific issue anyway, and I haven't seen any other reports. In general the recommendation stands that you need to minimize in-flight animations while also trying to do table view scrolling!

from marqueelabel-swift.

Spacelapp avatar Spacelapp commented on May 18, 2024

Yes, I fixed it by my own :) thanks anyway! you can close that

from marqueelabel-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.