1
Bitte helfen ... dieser Code über das Label fahren wird ....Etikettenüberschreibung in uicollectionview in Objective C
cellForItemAtIndexPath
static NSString *identifier = @"cellIdentifier";
[self.mycollectionViewOutlet registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cellIdentifier"];
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
cell.backgroundColor =[UIColor greenColor];
self.mycollectionViewOutlet.backgroundColor=[UIColor redColor];
objects_products * ob = [self.recipeImages objectAtIndex:indexPath.row];
UILabel *recipelableView = (UILabel*)[cell.contentView viewWithTag:LABEL_TAG];
if (!recipelableView)
recipelableView=[[UILabel alloc]initWithFrame:CGRectMake(50,115,100,50)];
[recipelableView setFont:[UIFont fontWithName:@"HelveticaNeue" size:12]];
recipelableView.textColor=[UIColor redColor];
[recipelableView setText:ob.price];
recipelableView.tag = LABEL_TAG;
[cell addSubview:recipelableView];
return cell;
R U mit einer Coustom-Zelle? –
Was ist dein Problem? ist auch der Code, den Sie in CellForItemAt eingefügt haben ...? –