【问题标题】:What are default methods that gets called when we scroll tableView iOS当我们滚动 tableView iOS 时调用的默认方法是什么
【发布时间】:2016-07-07 11:02:54
【问题描述】:

在我的 tableViewCell 中,我试图在带有背景图像的 textView 中显示来自 CoreData 字符串对象的动态内容。当 tableView 第一次加载时,背景图像向右拉伸并且 textView 中的文本内容正在修剪,但是当我滚动 tableView 时,背景图像的矩形按预期出现,但是 textView 内容仍在修剪。谁能告诉我滚动tableView时系统内部会调用哪些默认方法?因为某些方法正在正确设置我的背景图像矩形,而我在 tableView 的初始加载中未能设置。

【问题讨论】:

  • 你看过UITableViewDelegate吗?您的问题不清楚,提供一些代码并更好地描述您想要的。

标签: ios uitableview dynamic uitextview


【解决方案1】:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

【讨论】:

    【解决方案2】:
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    
    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    

    更多请查看 tableview 数据委托和数据源方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多