Я использую UICollectionView
. в табличном виде этикетка перегружает каждый раз, когда я пользуюсь этим кодомПерегрузка UILabel в UICollectionView
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5.0, 90.0,90.0, 21.0)];
[label setTag : indexPath.row];
label.text = [NSString stringWithFormat:@"%@",[arrImages objectAtIndex:indexPath.row]];
label.textColor = [UIColor redColor];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont boldSystemFontOfSize:12];
label.textColor = [UIColor colorWithRed:46.0/255.0 green:63.0/255.0 blue:81.0/255.0 alpha:1.0];
[cell.contentView addSubview:label];
return cell;
}
Помогите мне?
Который имеет средства перегрузки? – Dolo
cellForItemAtIndexPath его вызов при каждом прокрутке – codercat
@dolo overload означает, что загрузка меток каждый раз, когда я просматриваю представление коллекции, и это отображение нескольких ярлыков на одном изображении. – user2524618