Marquee effect for labels in iOS

AppsDev picture AppsDev · Jun 5, 2014 · Viewed 7.1k times · Source

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

Answer

Lavekush Agrawal picture Lavekush Agrawal · Jun 5, 2014

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.