【问题标题】:Transform UIViewController with UITableView into UITableViewController将带有 UITableView 的 UIViewController 转换为 UITableViewController
【发布时间】:2016-08-21 15:48:59
【问题描述】:

在 Storyboard 中,我使用 UITableView 作为根视图的子视图创建了 UIViewController。 UITableView 具有静态单元格内容。不幸的是,我在编译时遇到了“错误:静态表视图仅在嵌入 UITableViewController 实例时才有效”。

我的问题是:我可以将带有 UITableView 的 UIViewController 转换为 UITableViewController,因为从头开始在新的 UITableViewController 中重新创建我的 UITableView 非常困难。

【问题讨论】:

    标签: ios uitableview storyboard


    【解决方案1】:

    据我所知,你不能。当您从故事板编辑器右侧的对象列表中选择 UIViewController 或 UITableViewController 时,它会使用该预期类的特定属性初始化该场景。你能做的最好的就是拖入一个新的 UITableViewController 并手动复制你的单元格

    【讨论】:

    • 感谢您的想法,我只是将部分拖到新的 uitableviewcontroller
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 2016-01-04
    • 1970-01-01
    • 1970-01-01
    • 2013-10-23
    • 2013-01-03
    相关资源
    最近更新 更多