我正在尝试在 UITableViewCell 中打印 UIImageView 的框架,但我得到的是 {{0,0},{0,0}}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if(cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.font = [UIFont fontWithName:@"Arial" size:13.0f];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
//cell.imageView.frame = CGRectMake(2, 2, 38, 38);
}
NSString *imageName = [[itemsArr objectAtIndex:indexPath.row] objectForKey:@"image"];
cell.imageView.image = [UIImage imageNamed:imageName];
cell.textLabel.text = [[itemsArr objectAtIndex:indexPath.row] objectForKey:@"title"];
NSLog(@"Image Frame : %@", NSStringFromCGRect([cell.imageView frame]));
return cell;
}
我究竟做错了什么 ?