想要创建一个很酷的静态 UI 但:“静态表视图仅有效......" [英] Want to create a cool static UI but : "Static table views are only valid..."

查看:20
本文介绍了想要创建一个很酷的静态 UI 但:“静态表视图仅有效......"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个视图:

为此,我尝试使用故事板,在其中添加 2 个 TableView(均作为静态单元格"),然后我直接从故事板手动添加单元格内容...

For this I'm trying to use a Storyboard in which I add 2 TableViews (both as 'Static Cells') and then I manually add my Cell content directly from the storyboard...

在我的故事板中它看起来很棒但是当我构建时我得到:

In my storyboard it looks great but when I build I get:

en.lproj/MainStoryboard.storyboard:错误:非法配置:静态表视图仅在嵌入时有效UITableViewController 实例

en.lproj/MainStoryboard.storyboard: error: Illegal Configuration: Static table views are only valid when embedded in UITableViewController instances

我该如何解决这个错误?

How can I fix this error?

推荐答案

将 UITableViewController 添加到您的视图中.它应该包含一个 UITableView.将其定义为静态表视图,并将其分组.添加两个部分.一排一排,另一排两排.再次将标签按钮和滑块添加到行中.

Add a UITableViewController to your view. It should hold a UITableView. Define this as a static table view, and make it grouped. Add two sections. One with one row, and the other with two rows. Add your Labels buttons and sliders to the rows again.

我不知道你为什么要在这里有两个 UITableViews?

I do not know why you would want to have two UITableViews here?

这篇关于想要创建一个很酷的静态 UI 但:“静态表视图仅有效......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆