为什么UIcollection视图会在滚动后破坏Text的外观

时间:2014-04-15 01:26:49

标签: ios cocoa-touch uikit uicollectionview

基本上我有uiDynamics的uicollection视图,我将文本输入到每个单元格。当我跑步时,一切看起来都很棒!直到我滚动然后文本看起来变形了!

这是我插入文本的方式

UILabel *title = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, cell.bounds.size.width, 20)];
  //  title.backgroundColor = [UIColor blueColor];
    title.tag = 1;

    [title setText:@"Title"];
    title.font = [UIFont fontWithName:@"Corbert-Regular" size:13];

    [cell.contentView addSubview:title];

    UILabel *description = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, cell.bounds.size.width-100, 40)];
    description.tag = 2;

    [description setText:@"description"];
    description.font = [UIFont fontWithName:@"Corbert-Regular" size:16];

    [cell.contentView addSubview:description];

Before 滚动后:

enter image description here

0 个答案:

没有答案