【问题标题】:UITableView: Number of elements in footer in the last section [duplicate]UITableView:最后一部分页脚中的元素数[重复]
【发布时间】:2013-05-04 23:49:22
【问题描述】:

我想知道如何使UITableView的最后一部分出现在iPhone联系人应用程序中的表格中的元素数量:

谢谢

【问题讨论】:

  • 您是否尝试过仅添加另一行与您拥有的条目数?或者,如果它真的在页脚中,那么使用与普通行相同的样式在最后一部分添加页脚怎么样?!只是一些想法:-)
  • 我认为它只是一个常规的漂亮格式的 UITableViewCell。

标签: ios uitableview footer


【解决方案1】:

【讨论】:

    【解决方案2】:

    您可以添加一个 tablview 委托方法:

    - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    
        //add a uilabel with number of contacts text 
    }
    

    希望这会有所帮助。

    【讨论】:

      【解决方案3】:

      您可以像这样从表部分中获取行数:

      int rowCount = 0;
      
      for(int SECTION_NUMBER = 0 ; SECTION_NUMBER < numOfSections ; i++)
      {
      
          rowCount += [tablePropertyName numberOfRowsInSection:SECTION_NUMBER];
      }
      

      这里 rowCount 将是所有行的总数。 所以你可以在 tablefooter 方法中显示 rowCount

      - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
      
          //Here pass rowCount in label text
      }.
      

      希望对你有帮助。

      【讨论】:

      • 我认为这是唯一的可能性。你知道我可以用什么字体使它看起来像图片中显示的那样吗?
      • 不,但我认为您可以通过拍摄快照来检查这一点,然后使用 Photoshop 获取字体
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-23
      • 2011-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多