MarqueeLabel没有工作,它只是在屏幕上显示为UILabel

AKS*_*KST 0 iphone ios

我在项目中包含了https://github.com/cbpowell/MarqueeLabel链接中的文件

MarqueeLabel *continuousLabel2 = [[MarqueeLabel alloc] initWithFrame:CGRectMake(10, 440, self.view.frame.size.width-20, 20) rate:10 andFadeLength:10.0f]; 
continuousLabel2.tag = 101;
continuousLabel2.marqueeType = MLContinuous;
continuousLabel2.animationCurve = UIViewAnimationOptionCurveLinear;
continuousLabel2.continuousMarqueeExtraBuffer = 50.0f; 
continuousLabel2.numberOfLines = 1; 
continuousLabel2.opaque = YES; 
continuousLabel2.enabled = YES; 
continuousLabel2.textAlignment = NSTextAlignmentLeft; 
continuousLabel2.textColor = [UIColor colorWithRed:0.234 green:0.234 blue:0.234 alpha:1.000]; 
continuousLabel2.backgroundColor = [UIColor clearColor]; 
continuousLabel2.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.000]; 
continuousLabel2.text = @"This is another long label that scrolls continuously with a custom space between labels! You can also tap it to pause and unpause it!"
[self.view addSubview :continuousLabel2];
Run Code Online (Sandbox Code Playgroud)

我已经在我的项目中粘贴了上面的代码,但文本只显示为UILabel,而不是作为选框.请指教

Viv*_*wat 11

把它放在代码的末尾

 [continuousLabel2 restartLabel];
Run Code Online (Sandbox Code Playgroud)

要么

[self performSelector:@selector(startlabel) withObject:nil afterDelay:1.0];
-(void)startlabel{
        [continuousLabel2 restartLabel];
}
Run Code Online (Sandbox Code Playgroud)