AppsDev
AppsDev

Reputation: 12499

Marquee effect for labels in iOS

Is there any equivalent to the Android's android:ellipsize="marquee" for iOS? I've read some posts here regarding this scrolling text effect in iOS and it seems that you need either to implement the animation yourself with a timer, either use a third-party control, but those posts are a bit old and I need to make sure that the iOS SDK does not include a way to display this effect to its labels...

If the only way is to code it yourself or use another control, which control (open and free, and allowed for commercial apps) would you recommend?

Thanks a lot

Upvotes: 4

Views: 7643

Answers (2)

Lavekush
Lavekush

Reputation: 6166

You can use some think like WebView and apply the properties of scrolling on that WebView like this:

In android its seems like to be this:

String summary = "<html><body><marquee>This is basic example of marquee</marquee></body></html>";
webview.loadData(summary, "text/html", null);

The text will be moving from right to left.

I don't know how can I do it in iPhone or iOS,

But by the same way you use it into your iOS UIWebView Object.

Hope this will be helpful for you.

You can also use JavaScript in WebView and can apply various type of scrolling.

Upvotes: 3

Nitesh Borad
Nitesh Borad

Reputation: 4663

You can use MarqueeLabel:

Objective C and Swift: https://github.com/cbpowell/MarqueeLabel

Upvotes: 3

Related Questions