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