UITableViewCell'e alt görünümler eklerken sorun yaşıyorum. Tablo boyutu iPhone boyutunun altında olduğunda çalışıyor. UITableViewCell'e altyazı ekle
Ama boyut daha büyük olduğunda, ben kaydırma ediyorum böyle bazı korkunç etkiyi yapar: Böyle olması gerekiyordu:
Sonraöyle düşünüyorum hücre yeniden kullanımından gelir. İşte benim kod bir örnektir:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *kCellIdentifier = @"UITableViewCellStyleSubtitle";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if (cell == nil) {
//construct the cell
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:kCellIdentifier] autorelease];
//clear the previuous content
NSLog(@"Il y a %d subviews", [[[cell contentView] subviews] count]);
//[[[cell contentView] subviews] makeObjectsPerformSelector: @selector(removeFromSuperview)];
NSLog(@"Il y a %d subviews", [[[cell contentView] subviews] count]);
[[cell textLabel] setBackgroundColor:[UIColor clearColor]];
[cell setSelectionStyle:UITableViewCellEditingStyleNone];
}
switch (indexPath.row) {
case 0:
[cell addSubview:titleEvent];
break;
case 1:
//load the owner logo
[cell addSubview:logoAsso];
break;
case 2:
//StartDate
[cell addSubview:clockImage];
break;
case 3:
//EndDate
[cell addSubview:clockEndImage];
break;
case 4:
//Address
[cell addSubview:adress];
break;
case 5:
//map
[cell addSubview:map];
break;
case 6:
//header
[Graphism configureSeparationCell:cell];
break;
case 7:
//descritpion
[cell addSubview:descriptionEvent];
break;
default:
break;
}
return cell;
}
subviews sınıfın attributs ve yöntemde viewDidLoad yapılandırılan vardır. Bana neyi yanlış yaptığımı söylerseniz, bu bir rahatlama olur. Böyle