cbess/AutoScrollLabel

Still can't get it to work...

famictech2000 opened this issue · 2 comments

  1. I have created all the autoscrolllabel .h and the .m files and lastly the macro.h file
  2. Included the autoscrolllabel.h header file in my ViewController file
  3. Added the IBOutlet AutoScrollLabel *autoScrollLabel; in the ViewController.h file (do I need to add @Property for the IBOutlet?????)
  4. Created a UIScrollView in the ViewController.m file as such:
    // Alocate and initialize scroll
    UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(120.0f, 0.0f, 320.0f, 60.0f)];
    scroll.contentSize = CGSizeMake(320, 700);
    scroll.showsHorizontalScrollIndicator = YES;
  5. Created the autoScrollLabel as such:
    autoScrollLabel.text = @"This text may be clipped, but now it will be scrolled.";
    autoScrollLabel.textColor = [UIColor blueColor];
    autoScrollLabel.labelSpacing = 35; // distance between start and end labels
    autoScrollLabel.pauseInterval = 3.7; // seconds of pause before scrolling starts again
    autoScrollLabel.scrollSpeed = 30; // pixels per second
    autoScrollLabel.textAlignment = UITextAlignmentCenter; // centers text when no auto-scrolling is applied
  6. Finally I added both the autoScrollText and the UIScrollView to the ViewController as such:
    // add autoScrollLabel
    [scroll addSubview:autoScrollLabel];
    // add scroll view to main view
    [self.view addSubview:scroll];
    // release label and scroll view
    [autoScrollLabel release];
    [scroll release];

When I run in simulator, the UIScrollView is present as i can see the scrolling bars when I pull on the area I created for the UIScrollView, but there is not text that is present and thus does not auto scroll?

Can you please let me know what I am missing?

Does anybody have an answer to this question!?

Where are you setting the size? Why are you putting it in a scrollview (asl is a scrollview subclass)?