我在 tableView 中有一个 customTableViewCell。我选择使用时突出显示单元格,
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
但是,tableView 如下图所示。
它隐藏 customCell 中的标签和文本。我只想简单地突出显示单元格而不隐藏背景图像和标签。我不知道我在哪里犯了错误,无论是在代码中还是在 IB 中。.
我在 tableView 中有一个 customTableViewCell。我选择使用时突出显示单元格,
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
但是,tableView 如下图所示。
它隐藏 customCell 中的标签和文本。我只想简单地突出显示单元格而不隐藏背景图像和标签。我不知道我在哪里犯了错误,无论是在代码中还是在 IB 中。.
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Your_imageView.highlightedImage = [UIImage imageNamed:@"Your_image_Name.png"];
这会很好用
嘿,我认为您需要将 customCell 中的标签和文本添加到cell.contentview。有关参考,请转到 Apple 开发人员文档。
http://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7
[_tableView deselectRowAtIndexPath:selectedIndexPath animated:YES];
将其放入查看 Will Appear 及其对我的作品,
NSIndexPath *selectedIndexPath;
也把它放到 .h 文件中
试试这个
UIView *viewSelected = [[[UIView alloc] init] autorelease];
viewSelected.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"cell_highlighted.PNG"]];
cell.selectedBackgroundView = viewSelected;