我有自定义表格 View 单元格。在 viewController 中,我想在放置在自定义单元格中的 UIlabel 中添加选取框效果。字幕工作完美,但我无法在自定义单元格标签中设置。 cell.uiprodname.text 是自定义单元格的标签。我的代码是
MarqueeLabel *Label2 = [[MarqueeLabel alloc] initWithFrame:CGRectMake(10, 100, self.view.frame.size.width-20, 20) rate:100.0f andFadeLength:10.0f]; <= here i want to set cell.uiprodname.text instead of cgrect.
Label2.font = [UIFont fontWithName:@"Helvetica-Bold" size:15.000];
Label2.text = cell.uiprodname.text;
[self.view addSubview:Label2];
我想在每个自定义单元格中使用选取框效果。
最佳答案
您需要通过 github check out 此代码
您还需要检查 MarqueeLabel 带来的问题 here
我个人确实使用过 MarqueeLabel,但它会导致应用程序随时随地卡住。因此,请务必下载升级版本。
关于iphone - 如何在 CustomTableViewCell 的 UILabel 上添加跑马灯效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18202606/