这是我的UITableViewCell的.m文件.
#import "ContentCardTableViewCell.h" #import <QuartzCore/QuartzCore.h> @implementation ContentCardTableViewCell - (void)awakeFromNib { // Initialization code [self setBackgroundColor:[UIColor clearColor]]; } - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { [super setHighlighted:highlighted animated:animated]; if (highlighted) { [self setBackgroundColor:[UIColor clearColor]]; // Recover backgroundColor of subviews. } } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if (selected) { [self setBackgroundColor:[UIColor clearColor]]; // Recover backgroundColor of subviews. } } @end
但是这个UITableViewCell中的一个视图在选择时消失了.我尝试了this和this以及更多但没有任何帮助.有什么我想念的吗?
解决方法
我有类似的问题.
如果我将selectionStyle设置为UITableViewCellSelectionStyleNone工作正常,问题解决了.
即;
如果我将selectionStyle设置为UITableViewCellSelectionStyleNone工作正常,问题解决了.
即;
在里面
– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
加
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
在返回牢房之前.希望它有效.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。