我已经将链接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];


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

最佳答案

把它放在代码的末尾

 [continuousLabel2 restartLabel];


要么

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

10-08 07:43