我想隱藏它沒有數據的其他細胞,因爲我填補了小區用戶拍照。顯示只有一格
例如
這是表視圖細胞,作爲用戶需要的細胞應該建立基本上示出了所覆蓋的小區的照片。
------------------- 1)------------------
hiding the cell
------------------- --------------------> -------------------
-------------------
當用戶拍攝照片的左側表視圖應該在右手邊。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info valueForKey:UIImagePickerControllerOriginalImage];
self.thumbnails = image;
[self.imageView setImage:image];
[self dismissViewControllerAnimated:YES completion:NULL];
self.imagePickerController = nil;
[self.view addSubview:tableViewCell];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString * CellIdentifier = @"CustomCell";
CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == Nil){
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
UIImage *thumbnail = self.thumbnails;
cell.photoInfoLabel.text = @"New";
cell.thumbnailImageView.image = thumbnail;
return cell;
}
爲什麼不直接插入一個新的細胞一旦用戶拍攝的圖像? – sbarow
如何一次插入一個單元? – TryingToLearn