Моя цель, когда значение равно нулю, метка должна исчезнуть. Прежде чем прокручивать свою работу, но когда я прокручиваю все ярлыки, появляюсь , и я не знаю почему? Вы можете найти ниже мой код:iOS, когда прокрутка скрыта не работает
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ORGContainerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ORGContainerCell"];
if(cell==nil){
cell = [[ORGContainerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ORGContainerCell"];
}
UILabel *headingLabel = [[UILabel alloc] initWithFrame:CGRectMake(293, 4, 27, 95)];
UIImageView *labelBackground = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"SUB TITLE BG.png"]];
Channel* getchannel = [categorieArray objectAtIndex:indexPath.section ];
NSMutableArray * getsub = getchannel.SubChannel;
if(getsub==nil){
tableView.frame = CGRectMake(0, 20, 320, 490);
headingLabel.hidden=YES;
headingLabel.alpha = 0;
}else{
headingLabel.alpha = 1;
[cell addSubview:headingLabel];
Channel *val = [getsub objectAtIndex:indexPath.row ];
headingLabel.text = val.ChannelName;
headingLabel.textColor = [UIColor orangeColor];
headingLabel.textAlignment = NSTextAlignmentCenter;
headingLabel.tag = 10;
headingLabel.backgroundColor = [UIColor clearColor];
headingLabel.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:14.0];
headingLabel.hidden = NO;
headingLabel.highlighted = YES;
headingLabel.highlightedTextColor = [UIColor blueColor];
// headingLabel.lineBreakMode = YES;
headingLabel.numberOfLines = 0;
headingLabel.lineBreakMode = UILineBreakModeCharacterWrap;
headingLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"SUB TITLE BG.png"]];
// [headingLabel addSubview:labelBackground];
}
if(indexPath.section%2==0){
cell.strdatefromfirst = @"paire";
cell.backgroundColor =RGB(234, 234, 234);
}else{
cell.strdatefromfirst = @"impaire";
cell.backgroundColor = RGB(196, 195, 194);
}
NSDictionary *cellData = [self.sampleData objectAtIndex:[indexPath section]];
NSArray *articleData = [cellData objectForKey:@"articles"];
[cell setCollectionData:articleData];
return cell;
}