2011-06-10 65 views
2

我在tableView中有一个customTableViewCell。使用选择时,我强调的细胞,iPhone SDK - 突出显示TableView中选定的单元格

cell.selectionStyle = UITableViewCellSelectionStyleBlue;

但是,在出现的tableView像下面的图像。

enter image description here

它隐藏在customCell标签和文字。我只想突出显示单元而不隐藏背景图像和标签。我不知道我犯了什么错误,无论是在代码还是在IB。 。

+0

您是否定制了您的TableView? – 2011-06-10 06:40:32

+0

只有单元格是自定义的。 – iOS 2011-06-10 06:41:44

+0

你是如何将你的子视图添加到单元格的? – Idan 2011-06-10 07:55:50

回答

0
[_tableView deselectRowAtIndexPath:selectedIndexPath animated:YES]; 

把这个以查看会出现,其作品对我来说,

NSIndexPath *selectedIndexPath; 

也把这个.h文件中也

0

试试这个

UIView *viewSelected = [[[UIView alloc] init] autorelease]; 
    viewSelected.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"cell_highlighted.PNG"]]; 
    cell.selectedBackgroundView = viewSelected; 
4
cell.selectionStyle = UITableViewCellSelectionStyleNone; 
cell.Your_imageView.highlightedImage = [UIImage imageNamed:@"Your_image_Name.png"]; 

这将工作正常

+0

为此,您需要使用CustomTableViewCell – 2012-07-17 12:37:34

相关问题