加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – UITableViewCell不会突出显示

发布时间:2020-12-14 18:08:29 所属栏目:百科 来源:网络整理
导读:出于某种原因,我的UITableViewCells都没有突出显示蓝色.在IB中,我将其设置为突出显示蓝色,并且我没有覆盖IB的代码. 你注意到可能导致这种情况的任何事情吗? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
出于某种原因,我的UITableViewCells都没有突出显示蓝色.在IB中,我将其设置为突出显示蓝色,并且我没有覆盖IB的代码.

你注意到可能导致这种情况的任何事情吗?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    int showID = [[[singleton.programs objectAtIndex:indexPath.row]objectForKey:@"id"]intValue];
    //creates the url and loads the list of products
    //NSLog(@"showID: %d",showID);
    URLCreator * productsURL = [[URLCreator alloc] initStandard:@"getProgramProductsForList"];
    [productsURL addParam:@"id" stringValue:[NSString stringWithFormat:@"%d",showID]];
    WebManager *productsWM = [[WebManager alloc]init];
    [productsWM load:[productsURL finalURL] withSelector:@selector(parseProducts) object:[NSNumber numberWithInt:showID]];
}

除了`@ property / @ synthesize @之外,我的自定义单元格目前还没有任何内容,但现在它是.

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

解决方法

你的情况很简单,解决它的最佳方法可能是制作一个正常工作的最小例子(带蓝色选择的默认表格视图单元格)并逐步添加(或二进制搜索步骤)直到它中断.

如果在添加一些内容后最小代码中断,那么您就可以找到问题所在.如果没有,并且您实际上已经达到了您在项目中使用的相同的东西,请比较并查看您没有注意到的差异.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读