1、当创建UIViewController添加UITableView时,
self.tableView =[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
2、当创建UITableViewController时,需要改变UITableViewStyle时,
使用self.tableView.style = UITableViewStyleGrouped; 会出现错误

查UITableViewController的SDK文档,发现:
Table views can have one of two styles, UITableViewStylePlain and UITableViewStyleGrouped. When you create a UITableView instance you must specify a table style, and this style cannot be changed.
可以在Xib文件的属性下直接修改为Group或Plain。
本文介绍了在iOS应用开发中UITableView的两种样式:Plain和Grouped。详细解释了如何在创建UITableView实例时指定样式,并说明了样式一旦设定便不可更改的特点。同时提供了在Xib文件中调整样式的建议。
579

被折叠的 条评论
为什么被折叠?



