.xib 中的 UITableView 没有内容属性
(XCode 4.2,iOS 5)
为了重用表格视图(带有导航栏和编辑/添加按钮),我创建了一个带有自己的 .xib
的 UITableViewController
子类。但是,当我将 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于试图解决这个问题的人来说,不可能在
.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:Xcode 6.3.2