Still can't get it to work...
famictech2000 opened this issue · 2 comments
famictech2000 commented
- I have created all the autoscrolllabel .h and the .m files and lastly the macro.h file
- Included the autoscrolllabel.h header file in my ViewController file
- Added the IBOutlet AutoScrollLabel *autoScrollLabel; in the ViewController.h file (do I need to add @Property for the IBOutlet?????)
- 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; - 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 - 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?
famictech2000 commented
Does anybody have an answer to this question!?
cbess commented
Where are you setting the size? Why are you putting it in a scrollview (asl is a scrollview subclass)?