[英]Static table view outside UITableViewController
After the new Xcode update, my app doesn't validate and shows this error:新的 Xcode 更新后,我的应用程序未验证并显示此错误:
static table views are only valid when embedded in UITableViewController instances
静态表视图仅在嵌入到 UITableViewController 实例中时才有效
Any chances to solve easily?有机会轻松解决吗?
The only way to get a static UITableView along with other controls on the same screen is to use a Container View.在同一屏幕上获得静态 UITableView 和其他控件的唯一方法是使用容器视图。 Follow this way, it works perfectly:
按照这种方式,它完美地工作:
Good luck.祝你好运。
This answer was already found and given here: G.Huebner -> http://web.archive.org/web/20140928102504/http://iphonedevsdk.com/forum/iphone-sdk-development/111800-static-table-view-cells-only-work-in-a-uitableviewcontroller.html这个答案已经在这里找到并给出:G.Huebner -> http://web.archive.org/web/20140928102504/http://iphonedevsdk.com/forum/iphone-sdk-development/111800-static-table- view-cells-only-work-in-a-uitableviewcontroller.html
A static UITableView must be in a UITableViewController.静态 UITableView 必须在 UITableViewController 中。 So you will have place the table in UITableViewController and then add it as childView to the MainViewController.
所以你将把表放在 UITableViewController 中,然后将它作为 childView 添加到 MainViewController。
You can refer https://iphoneidoit.blogspot.in/2013/10/static-uitableview-in-uiviewcontroller.html你可以参考https://iphoneidoit.blogspot.in/2013/10/static-uitableview-in-uiviewcontroller.html
I think what you are doing is you are first dragging the ViewController on the storyboard and then dragging the tableView on the ViewController.我认为您正在做的是首先在情节提要上拖动 ViewController,然后在 ViewController 上拖动 tableView。 In this way you can't use the Static table cells.
这样你就不能使用静态表格单元格。 Instead of this what you should have done is Drag the TableViewController on the main storyboard instead of a ViewController and then select the static cells.
而不是你应该做的是在主故事板上拖动 TableViewController 而不是 ViewController,然后选择静态单元格。 In this way you can be able to work on static cells and can use any elements on static cells.
通过这种方式,您可以处理静态单元格并可以使用静态单元格上的任何元素。
好吧,如果您真的在使用静态 tableView,则应该考虑将所有内容复制/粘贴到 ScrollView 或 StackView。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.