IOS-UITableViewStyle设置Group、Plain问题


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。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM