Discussion in 'iOS Programming' started by chhoda, May 28, 2009.

  1. chhoda macrumors 6502

    Oct 25, 2008
    i am required to do a marquee type scrolling of a label when the text is more than my scren width. any ideas ?

  2. detz macrumors 65816

    Jun 29, 2007
    You would probably have to use a fixed width font and calculate if it's too large for the screen. Actually, there might be functions that do around.
  3. Haruhi macrumors regular

    Sep 19, 2008
    That kind of thing, right?
  4. xStep macrumors 68000

    Jan 28, 2003
    Less lost in L.A.
    If this is in a tableview, then I think you'll be challenged. As I understand that each time you make a change, you have to redraw the cells all over again.
  5. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Use a UIScrollView and programmatically (in a loop or via a timer) set your contentOffset.
  6. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Write your own UIView Subclass. Set up a timer to setNeedsDisplay the view. Have it draw its text in its drawRect based on a position. Move the position to the left on each iteration of the timer. Double the text so it automatically draws the start of the text after the end of the text. Figure out when you need to restart the text from the beginning.

Share This Page