내 뷰 셀에 사용자 지정 uitableviewcell이있는 사용자 지정 UI가 있습니다. 셀이 두 번째로드에 표시되지 않습니다. 즉, 내가이 견해에서 다른 견해로 돌아가서이 견해로 돌아갈 때입니다.사용자 지정 UITableViewCell이 두 번째로드에 나타나지 않습니다.
내보기에서 테이블을로드하는 방법입니다. 내가 다른보기를
AppDelegate_iPhone *appDelegate = [[UIApplication sharedApplication] delegate];
AddPestReportStepOne *report = [[AddPestReportStepOne alloc]init];
[appDelegate.navCon pushViewController:report animated: YES];
[report release];
을 이동하는 방법
CropTableViewController *cropTblViewCon = [[CropTableViewController alloc]init];
self.cropTableViewController = cropTblViewCon;
cropTableViewController.view.frame = cropTblView.frame;
[cropTblView removeFromSuperview];
[self.view addSubview:cropTableViewController.view];
self.cropTblView = cropTableViewController.tableView;
이이 내가 내 사용자 정의 테이블보기에서 내 테이블 셀을로드하는 방법입니다.
static NSString *CellIdentifier = @"CustomCropCell";
CustomCropCell *cell = (CustomCropCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
tableView.scrollEnabled = NO;
// tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"CustomCropCell" owner:nil options:nil];
for (id currentObject in topLevelObjects){
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (CustomCropCell *) currentObject;
break;
}
}
}
//if (counter<6) {
CropEntity *crop = [[CropEntity alloc] init];
crop=[ cropList objectAtIndex:counter];
NSString *imgStr = [NSString stringWithFormat:@"%@%@%@",domainName,cropImagePath, [crop cropImage]];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imgStr]]];
CGSize size = CGSizeMake(80, 80);
[cell setBackgroundColor: [UIColor clearColor]];
image = [Utilities scale:image toSize:size ];
[cell.columnOne setTag: [[crop cropId] integerValue] ];
[cell.columnOne setTitle:[crop cropName] forState:UIControlStateNormal];
[cell.columnOne setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[cell.columnOne setTitleEdgeInsets:UIEdgeInsetsMake(0.0, -image.size.width, -75.0, 0.0)]; // Left inset is the negative of image width. counter = counter+ 1;
[cell.columnOne setImage:image forState:UIControlStateNormal];
[cell.columnOne setImageEdgeInsets:UIEdgeInsetsMake(-15.0, 0.0, 0.0, -cell.columnOne.titleLabel.bounds.size.width)]; // Right inset is the negative of text bounds width.
[cell.columnOne setBackgroundColor: [UIColor clearColor]];
counter = counter + 1;
행이 제거되지 않은 것으로 보입니다. 내 cellforrowat indexpath 증가 계속 ...