我有customtableview单元格。在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];
我想在每个自定义单元格中使用选框效果。
答案 0 :(得分:1)
这可能对您有所帮助,我试过这篇博文moving 'label text'.
答案 1 :(得分:1)
您需要通过github
结帐此代码您还需要检查MarqueeLabel here
附带的问题我个人确实使用过MarqueeLabel但它会导致应用程序随时随地卡在任何地方。因此,请确保下载已升级的版本。
答案 2 :(得分:0)
为了清楚起见,请按照以下教程创建自定义UITableView
。
在该教程中,当您拖放UILabel
时,将其检查器中的类更改为所需的类(我猜MarqueeLabel)。然后将其拖入.h文件并继续。