美文网首页
iOS学习笔记9 tableview的数据添加与删除

iOS学习笔记9 tableview的数据添加与删除

作者: 蠢萌的L君 | 来源:发表于2016-04-12 08:39 被阅读470次
[self.tableview.reloadData];

//要有动画就调用下面方法
[self.tableview insertRowsAtIndexPath:@[NSIndexPath indexPathForRow:0 inSection:0]....]
//或者delete开头的方法

数据刷新原则

  • 修改模型数据
  • 调用数据刷新方法
  • 不要直接修改cell属性

图片拉伸处理

  // 拉伸处理(说明需要保护的区域)
//瓦片平铺
 image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30) resizingMode:UIImageResizingModeStretch];
 // 
image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];

相关文章

网友评论

      本文标题:iOS学习笔记9 tableview的数据添加与删除

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