.xib 中的 UITableView 没有内容属性

发布于 2024-12-28 08:32:32 字数 324 浏览 2 评论 0原文

(XCode 4.2,iOS 5)

为了重用表格视图(带有导航栏和编辑/添加按钮),我创建了一个带有自己的 .xibUITableViewController 子类。但是,当我将 UITableView 添加到 .xib 的主视图时,内容属性(我想将其设置为动态原型)它不会显示。它仅显示示例内容(加利福尼亚州:Brea、Burlingame...)。当我在主情节提要中添加 UITableView 时,内容属性确实会显示。

有什么问题吗?

(XCode 4.2, iOS 5)

In order to reuse a tableview (with a navigation bar and edit/add buttons) I created a UITableViewController subclass with it's own .xib. However, when I add a UITableView to my .xib's main view the content attribute (which I want to set to dynamic prototypes) it doesn't show up. It just shows the sample content (California: Brea, Burlingame, ...). When I add a UITableView in my main storyboard the content attribute does show up.

What is the issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪痕残 2025-01-04 08:32:32

对于试图解决这个问题的人来说,不可能在 .xib 中设置动态原型单元,甚至静态单元。 .xib 文件中不支持嵌入部分或单元格。
如果将表视图控制器拖到 .xib 中,您将收到错误消息:

仅支持带有嵌入部分和单元格的表格视图
故事板文档

Xcode 6.3.2

For people trying to solve this, it is impossible to set dynamic prototypes cells in a .xib, or even static cells. No embedded sections or cells are supported in .xib files.
If you drag a Table View Controller into a .xib, you'll get an error:

Table views with embedded sections and cells are only supported in
storyboard documents

Xcode 6.3.2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文