marquee

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

  1. chhoda macrumors 6502

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

    --CH
     
  2. detz macrumors 65816

    Joined:
    Jun 29, 2007
    #3
    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 this...google around.
     
  3. Haruhi macrumors regular

    Joined:
    Sep 19, 2008
    #4
    <marquee>YO<marquee>
    That kind of thing, right?
     
  4. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #5
    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

    dejo

    Staff Member

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

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    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