若是你直接在 UIViewController 中加入一个 UITableView 并将其 Content 属性设置为 Static Cells,此时 Xcode 会报错:html
Static table views are only valid when embedded in UITableViewController instances.spa
意思是说,若是 UITableView 不是在 UITableViewController 而是在 UIViewController 中的时候,是不容许将 UITableView 的 Content 属性设置为 Static Cells 的。code
可是,若是想让 UIViewController 中的 UITableView 是一个 Static Cells 的怎么办呢?htm
方法是有的!既使用Container View在中间链接一下。blog
步骤以下:get
效果:table