Prerna chavan
Prerna chavan

Reputation: 3249

UILabel text glow and marquee

I am using this for scrolling the uilabel text and this for glow effect. However i want both glow and marquee uilabel text, i have replaced UILabel with RSSGlowLabelclass from above code. but i am not getting the glow effect. can any body tell me how can i achieve that.

Upvotes: 1

Views: 3186

Answers (1)

Jezen Thomas
Jezen Thomas

Reputation: 13800

It's probably much easier if you code it yourself. Start with this:

float alph = 0.7;

- (void)viewDidLoad {
    [super viewDidLoad];
    glowLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
    NSString *string = @"some text";
    glowLabel.text = string;
    glowLabel.textColor = [UIColor blueColor];
    [self.view addSubview:glowLabel];
    glowLabel.alpha = alph;
    [NSTimer scheduledTimerWithTimeInterval:0.4
                                   target:self
                                   selector:@selector(glowMarquee)
                                   userInfo:nil
                                   repeats:YES];
}

-(void)glowMarquee {
    alph = (alph == 1) ? 0.7 : 1; // Switch value of alph
    [UIView beginAnimations:@"alpha" context:NULL];
    [UIView setAnimationDuration:0.4];        
    glowLabel.alpha = alph;
    [UIView commitAnimations];
}

Now just add the marquee logic to the glowMarquee method, or create a separate method for the marquee and another timer to control it, so the two can be controlled independently.

Upvotes: 4

Related Questions