使用containerView在UIViewController实现staticCell的使用

今天在做项目在UIViewController中的UItableview使用staticCell,刚在storyboard中的tableView设置完staticCell,就出现Static table views are only valid when embedded in UITableViewController instances警告。是说staticCell只能在UItableviewController使用。那么在UIViewController中还可以使用staticCell吗?答案是肯定的。这要借助container来实现。container就是一个容器,可以放ViewController。我们在storyboard拖一个container在UIViewController中,,然后在拖一个UItableviewController在storyboard中。然后从containerView拖一segue选择embed。这样就能实现在UIViewController实现staticCell的使用。在如下图

接受失败,是我们不常听到或看到的一个命题,

使用containerView在UIViewController实现staticCell的使用

相关文章:

你感兴趣的文章:

标签云: