美文网首页
UITableView右边索引 点击无效

UITableView右边索引 点击无效

作者: 如此之6 | 来源:发表于2018-10-15 17:55 被阅读75次

今天发现UITableView右边索引的点击无效,然后一阵忙碌检查原因,百度google后依然没有发现问题。

最后反复检查对比代码,发现原来是右边索引重复问题,直接上问题代码

-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView{

    return sectionTitles;

}

因为我们这个页面有两个UITableView,第二个UITableView是处于隐藏状态,没有右边索引栏的。

-(NSArray *)sectionIndexTitlesForTableView:(UITableView*)tableView{

    if(tableView == myTableView) {

        return myInfoArray;

    }

    return nil;

}

这样修改就好了。

相关文章

网友评论

      本文标题:UITableView右边索引 点击无效

      本文链接:https://www.haomeiwen.com/subject/isfqzftx.html