2013-02-23 86 views

回答

1

如果您使用的子类为NSTextFieldCellImageAndTextCell)。你可以在
- (NSRect)imageRectForBounds:(NSRect)cellFrame方法中控制图像的位置。

0

而不是默认TableViewCell,创建您自己的自定义tableViewCell并根据您的需要来定位它。

1

可以创建自定义单元格...

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

    static NSString *CellIdentifier = @"ImageOnRightCell"; 

    UIImageView *photo; 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]]; 
     cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 

     photo = [[[UIImageView alloc] initWithFrame:CGRectMake(225.0, 0.0, 80.0, 45.0)]]; 
     photo.tag = PHOTO_TAG; 
     photo.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; 
     [cell.contentView addSubview:photo]; 
    } else { 
     photo = (UIImageView *)[cell.contentView viewWithTag:PHOTO_TAG]; 
    } 
    return cell; 
} 

这看起来就像.... enter image description here 或U可以读取此链接.... http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/TableViewCells/TableViewCells.html

+0

感谢您的帮助..... :-) – Fritzables 2013-02-24 06:46:00