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即可。

  • 相关阅读:
    JVM StackOverflowError vs. OutOfMemoryError
    db2 command line notes
    my emacs configuration
    repackage android application
    file -i haha.csv
    QualType in clang
    STM in Clojure
    32bit / 64bit co-exist Linux, ld-linux.so, linux-gate.so.1 etc
    hash tree
    K-S Test
  • 原文地址:https://www.cnblogs.com/Rinpe/p/5124963.html
Copyright © 2011-2022 走看看