zoukankan      html  css  js  c++  java
  • Probably at least one of the constraints in the following list is one you don't want.

    这个提示并不是出错,不理会它我的程序也没出现什么问题

    但是处于强迫症,还是努力寻找解决的方法。。。

    最终发现问题如下:

    在xib各种绘制和添加约束的UITableViewCell之后,在某一特定情况想要隐藏这个Cell,于是我就在UITableView的

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath方法中返回0,所以出现了这个提示!

    这里需要注意到一个问题:

    有些人可能会想到通过reloadData方法,然后在

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath方法中return nil来实现隐藏这个Cell,

    这样是行不通的。。会报错!

    我的解决方法如下:

    就是另外创建一个什么内容都没有的Cell来取代这个要隐藏的Cell,然后在

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath方法中返回0即可。

  • 相关阅读:
    15回文相关问题
    14海量日志提取出现次数最多的IP
    13概率问题
    12胜者树和败者树

    pysnmp程序
    python 多线程 生产者消费者
    python多线程
    pysnmp使用
    PyYAML使用
  • 原文地址:https://www.cnblogs.com/Rinpe/p/5124963.html
Copyright © 2011-2022 走看看