最近在自学swift,准备把学习心得做一个总结。能写到什么地方算什么地方吧,以后慢慢补充。

1. UITableView需要绑定至当前的ViewController。右键拖动UITableView 至ViewController,分别绑定UITableViewDataSource和UITableViewDelegate。绑定后UITableView方可获取数据。

2. ViewCOntroller类必须遵循UITableViewDataSource,UITableViewDelegate两个协议

UITbleView操作总结

3. 常用的方法和属性

UITbleView操作总结

用于指定section中返回的行数(必选)

UITbleView操作总结

用于设置返回的tableview中每一行的样式,indexPath为被选中行的行号,从0开始。比如,标题,图标,被选中时高亮标记的颜色等等。

 cell.selectionStyle = UITableViewCellSelectionStyle.None --- 被选中时cell颜色不变

UITbleView操作总结

用于设置行高

UITbleView操作总结

用于设置整个section foot viewer的高度

UITbleView操作总结

通过返回值设置整个section title的值

 

相关文章:

  • 2021-06-30
  • 2021-12-08
  • 2021-07-02
  • 2021-07-12
  • 2021-12-12
  • 2022-02-07
  • 2021-08-16
  • 2022-02-15
猜你喜欢
  • 2021-11-21
  • 2021-11-21
  • 2022-01-01
  • 2021-07-12
  • 2021-04-09
  • 2021-05-29
  • 2021-11-25
相关资源
相似解决方案