2011-06-10 67 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

相關問題