4

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

Hemang
  • 26,840
  • 19
  • 119
  • 186
AppsDev
  • 12,319
  • 23
  • 93
  • 186

2 Answers2

3

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.

AADProgramming
  • 6,077
  • 11
  • 38
  • 58
Lavekush Agrawal
  • 6,040
  • 7
  • 52
  • 85
  • 1
    Good trick! In iOS you should use `UIWebView` to load HTML into it. [Here's a reference link](http://stackoverflow.com/questions/7063276/how-to-load-local-html-file-into-uiwebview-iphone) – Hemang Jun 05 '14 at 10:44
  • the answer should be updated to this: webview.loadHTMLString(summary, baseURL: nil); – zwebie Mar 16 '16 at 16:12
3

You can use MarqueeLabel:

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

Chuck
  • 179
  • 1
  • 9
Nitesh Borad
  • 4,583
  • 36
  • 51